Forum Discussion
Cumulative total Column with dynamic ranking Column
- 4 years ago
Hi, Anonymous
Try this:RunningTotal = VAR _currank2Table = ADDCOLUMNS ( 'MAESTRO V2 - Tesson''s Curve', "_Ranking Ter", [Ranking Ter] ) RETURN SUMX ( FILTER ( ALL ( _currank2Table ), [_Ranking Ter] < [Ranking Ter] ), [TO ] )If this does not work, for a quick fix, consider sharing the dummy sample data and expected output.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 4 years ago
Hi, Anonymous
Try this:_RunningTotal CST = //*********************************************************************************************************** // solution: only need one measure VAR _CURRENT_perNM=MAX('Tesson''s Curve'[NM%]) VAR _sumx=SUMX(FILTER(ALLSELECTED('Tesson''s Curve'),'Tesson''s Curve'[NM%]>=_CURRENT_perNM),[TO ]) return _sumxResult:
If it's just to get cumulative totals, you only need this one measure.
But you can use the ranked column sorting table, which, by the way, I recreated to be a more concise ranking measure hopefully useful to you.Please refer to the attachment below for details.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Anonymous
Calculated columns are only calculated when you first define them and during a dataset refresh.
Unlike a calculated column, measures are evaluated on the fly with every change in context. If you change a date filter from 2019 to 2020, all the measures will be calculated again. While this is nice for seeing context-based calculations in real-time.
Workarounds.
1. create dynamic ranking measure, as you did above.
2. Create cumulative totals as a measure instead of calculated column.
Refer:
Power BI: Calculated Measures vs. Calculated Columns
Calculated Columns and Measures in DAX
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
Hello Dear v-angzheng-msft,
thanks for your reply.
I underestood now that only the ranking measure are calculated based on the filter applied.
But in that case, Is it possible to create a cumulative total using that ranking measure ?
That's one thing I am trying to do but I don't know how to do ...
If you have any idea, thanks for your help.
Kind regards,
Guillaume
- v-angzheng-msft4 years agoCommunity Support
Hi, Anonymous
sorry for the late reply.
Yes, you can create cumulative totals based on dynamic ranking measures, but as I mentioned above, cumulative totals also need to be a measure.Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Anonymous4 years agoNot applicable
Dear v-angzheng-msft ,
Thanks for the reply.However, How do you do ? so far, I ma not succeeding in making it work as I would ...
Here is my table with the measures :As you can see, the "Running Total" is not linked to my "Ranking Ter" (which is dyanmic, it moves based on the selection).
Here is my formula for the "Running Total" :
RunningTotal =VAR currank2='MAESTRO V2 - Tesson''s Curve'[Ranking Ter]RETURNCALCULATE(sumx('MAESTRO V2 - Tesson''s Curve',sum('MAESTRO V2 - Tesson''s Curve'[TO ])),FILTER(ALL('MAESTRO V2 - Tesson''s Curve'),[Ranking Ter]<currank2))And I don't see how I could do better honestly ...If you have any idea, I would gladly take it !Thanks for your help.Kind regards,Guillaume