Forum Discussion
Anonymous
3 years agoNot applicable
DAX Measure (Dynamic Cumulative Sum)
I want to create the cumulative total based on the rank (in this case a Measure Count), unfortunately I can't get it to work with this attempt. I always get the total and not the running total.
Do you have any idea how to do it?
Lines_Cum =
VAR CURRENTRANK = [COUNT]
RETURN
SUMX(
FILTER(
ALL(FAKTWA_DAT),
Currentrank <= MAXX(FaktWA_DAT,[Count])
),
[LINES]
)
COUNT = RANKX(ALL(FaktWA_DAT),[AS_Index],,ASC,DENSE)-1
2 Replies
- Greg_DecklerCommunity Champion
Anonymous Try:
Lines_Cum = VAR CURRENTRANK = [COUNT] RETURN SUMX( FILTER( ALL(FAKTWA_DAT), [Count] <= Currentrank ), [LINES] )- AnonymousNot applicable
unfortunately it didn't work, I found another solution. (Index made in PQ and then SUMX with AS_LINES (dynamic Lines) but it only works for counts smaller than 1000. After that, the working memory has problems and displays an error message.
Lines_Cum =
SUMX(
FILTER(
ALL(FAKTWA_DAT),
FaktWA_DAT[Index] <= MAX(FaktWA_DAT[Index])
)
,[AS_Lines]
)