cancel
Showing results for 
Search instead for 
Did you mean: 

How does model calculation Restrict function on Current year work

former_member234401
Active Participant
1,747

Hi all

I have created a formula RESTRICT([Sales] , [d/Order_Date]= Current("Year"))

I am using a dynamic date filter, but when consumed in a story the measure does not behave as I expect. I would expect it to select current year - but you need to add a filter to the VIZ on the year. So what is the difference then?

I have attached a picture, The sales KF does not contain any restrict - the other one (highlighted) is the one with the formula described above. There are no filters on time dimension in the VIZ

I could choose a hard coded filter in the restricted KF on the year = 2018, and then it's filtered on 2018.

My question is: How is the intended behavior of the dynamic filter "Current Year" on a time dimension ?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member234401
Active Participant

Hi John I am aware of this - I am just wondering why

Then you would never use the current() as this is controlled by time / date dimension you have in the filter

And if I add these two calculations:

RESTRICT([Sales] ,[d/Order_Date]= Current("Year"))

RESTRICT([Sales] ,[d/Order_Date]= Current("Year").Current("Month"))

to the same chart - I am not able to show then in the same time

and the function: RESTRICT([Sales] ,[d/Order_Date]= Previous("Year",1)) - is not picked up by the story (and I have applied all sorts of filtering)

and you have the information in the dynamic time filter - why not utilize it in the measures made in the model

and I am missing an offset here - so I can select the previous month

could not the this one to work

RESTRICT([Sales] ,[d/Order_Date]= Current("Year").Previous("Month",1))

- and I selected a single month (I tried with fixed filter and the dynamic)

JohnL
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rene,

Have you read the section "Dynamic Time Navigation Functions" in the Home > Formulas and Calculations > Restrict and Lookup online help document?

Current() is referring to the current member. You need to have the time / date dimension in a filter.

Its not selecting the current calendar year (2019). That is not supported in the Dynamic Time Navigation Functions.

HTH

John

Henry_Banks
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi jacob.stark Hi christina.obry - do you have any comments on this ? cheers, H