Forum Discussion
Anonymous
5 years agoNot applicable
Dynamic DATESINPERIOD function
Hi, I have an SSAS Tabular cube which feeds most of my PBI Desktop Reports. I am trying to build a measure which compares the selected period in a date filter with the same period prior (in days) ...
- Anonymous5 years ago
Hi, my bad sorry - I had a filter applied which was causing the zero
Anonymous
5 years agoNot applicable
Hi this works fine for a static 3 day period however I want it to be dynamic so if the number of days between the selected dates is 14 for example, it would show the data from the period 14 days.
amitchandak
5 years agoSuper User
Anonymous ,
you can replace it with what-if parameter ?
Rolling 3 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX(Sales[Sales Date]),-1* selectedvalues(param[param]),Day))
Rolling 3 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-1* selectedvalues(param[param]),Day))
https://docs.microsoft.com/en-us/power-bi/desktop-what-if