Forum Discussion
Cummulative Sum responding to Slicer
Hi all,
I am trying to create a cummulative sum which goes with the slicer, meaning if I select the numbers: 3, it will retrieve the data all to the number 3.
It doenst allow me saying i cant use MAX for a true or false function... really don´t know how to do so
Hi Anonymous ,
You may create measure like DAX below.
Measure1= CALCULATE(SUM(MS_CY[CY.NS3rd]),FILTER(ALLSELECTED(MS_CY), MS_CY[UnitName]=MAX(MS_CY[UnitName])&&MS_CY[Periodnumber]<=MAX(MS_CY[Periodnumber])&&MS_CY[TimeBasis]="Periodic"))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Nathaniel_C
Community Champion
Hi Anonymous ,
Do something like this where the you use var for the date, or number.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
NathanielTotal Cumulative hours = VAR MaxDate = MAX ( aver[Date] )-- Saves the last visible date var Hours = CALCULATE ( [Total Hours measure], -- Computes hours aver[Date]<= MaxDate, -- Where date is before the last visible date ALLEXCEPT( aver,aver[Program] ) -- Removes any other filters from Date allexcept aver[Program] ) return Hours- AnonymousNot applicable
No it doesnt work.
I have an additional variable which is unit name. So basic i need to:
1. Sum all values cummalative based on period numbers
2. Filtered by:
- Unit name (i must have a accumulated value by each unit name)
3. Showing data only for
- Periodic bases (it´s a columm which has periodic and MTD)
- v-xicai
Community Support
Hi Anonymous ,
You may create measure like DAX below.
Measure1= CALCULATE(SUM(MS_CY[CY.NS3rd]),FILTER(ALLSELECTED(MS_CY), MS_CY[UnitName]=MAX(MS_CY[UnitName])&&MS_CY[Periodnumber]<=MAX(MS_CY[Periodnumber])&&MS_CY[TimeBasis]="Periodic"))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.