Forum Discussion
Rolling by month
Hi Guys.
I have the following formulas:
What I am after is how can I roll the total of Total_V2. For example, I would like Jan to be 695, Feb to be 695*2, Mar to be 695*3 and so on.
Is there any way I can apply a rolling DAX Calculation to any of the measures?
- Anonymous2 years ago
Hi azakir ,
You can try the following dax.
MEASURE = VAR _monthnumber = MONTH ( MAX ( 'DateDim'[Date] ) ) VAR CurrentDate = MAX ( DateDim[Date] ) VAR _sum = CALCULATE ( [Waste To Landfill Graph2_V1], FILTER ( ALL ( DateDim ), DateDim[Date] <= CurrentDate && DateDim[Previous Year] = 1 ) ) VAR _round = ROUNDDOWN ( _sum, 0 ) RETURN _round * _monthnumberBest Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
9 Replies
- AnonymousNot applicable
Hi azakir ,
You can try the following dax.
MEASURE = VAR _monthnumber = MONTH ( MAX ( 'DateDim'[Date] ) ) VAR CurrentDate = MAX ( DateDim[Date] ) VAR _sum = CALCULATE ( [Waste To Landfill Graph2_V1], FILTER ( ALL ( DateDim ), DateDim[Date] <= CurrentDate && DateDim[Previous Year] = 1 ) ) VAR _round = ROUNDDOWN ( _sum, 0 ) RETURN _round * _monthnumberBest Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- azakir
Resolver I
Hi Anonymous This did the trick. Thank you
- Ashish_Mathur
Super User
Hi,
What are you trying to achieve? Why should Feb be 695.06*2 and so on?
- azakir
Resolver I
Hi Ashish_Mathur . Thanks for the reply. What I am trying to achieve is the total 695 being rolled up every month. So the requirement is whatever the total was last year (695 in this case) make it a target for this year with every month being rolled up by the same total.
- Ashish_Mathur
Super User
Share the download link of the PBI file.