Forum Discussion
claudirnava
2 years agoFrequent Visitor
Cumulative sum calculated field
Hello I want to create a cumulative sum but the ammount that I´m intended to use is a calculated field. I´m not wokinr with date because I just want to sum the ammounts once they are sorted in de...
claudirnava
2 years agoFrequent Visitor
Anonymous
Hello Yilong
The problem that I have is that the measure [MAT] is a calculated field is not part of the table, so I tried to calculate a cummulative sum of a calculated field. This is the expression that I used to calculated the MAT:
MAT = CALCULATE(
SUM( 'Consumos Onco'[Measure Values] ),
DATESINPERIOD( calendario[Date] , MAX( calendario[Date] ) , -12 , MONTH )
)
And I want to crate the cummulate sum of "Participacion Total" this is the expression:
Participacion Total = DIVIDE([MAT],
CALCULATE (
SUM ( 'Consumos Onco'[Measure Values] ),
FILTER ( ALL ( 'Consumos Onco' ), [Measure Names] = "Consumo" ),DATESINPERIOD( calendario[Date] , MAX( calendario[Date] ) , -12 , MONTH )
))
The proble is that I dont know how to calcualte a cummulative sum of a calculated field
Anonymous
2 years agoNot applicable
Hi claudirnava ,
I think you can change your DAX code.
Cumulative Participacion Total =
CALCULATE(
SUMX(
FILTER(
ALLSELECTED(calendario[Date]),
calendario[Date] <= MAX(calendario[Date])
),
[Participacion Total]
)
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.