Forum Discussion
mfattibello
8 years agoRegular Visitor
Problems on implementing RunningSum measure using DAX
Dear, I´m facing problems on implementing RunningSum measure using DAX. I have a rank measure showing the best revenues on a determined period and another dimension´s elements, according with ...
MFelix
8 years agoSuper User
Hi mfattibello,
I'm assuming you have another column on your table that identifies the ranking and not only based on the value.
Try this measure and see if it works:
CUMULATIVE =
VAR Sum_Revenue =
SUM ( Ranking[Revenue] )
RETURN
IF (
NOT ( ISBLANK ( Sum_Revenue ) ),
CALCULATE ( Sum_Revenue ),
FILTER ( ALL ( Ranking[TYPE] ), SUM ( Ranking[Revenue] ) <= Sum_Revenue )
)As you can see in my formula I assumed you have a TYPE column in wich you make the ranking work.
In this table the Ranking is made using the revenue column
Ranking = RANKX(ALL(Ranking[Revenue]),CALCULATE(SUM(Ranking[Revenue])))
However to make the cumulative total I have to use another column (TYPE).
Regards,
MFelix