Forum Discussion
Cumulative total while switching values
- 2 years ago
Hi itsmeanuj
If I understood you correctly and you are working with the field parameters you can apple the following steps :
1. Add to the field parameter column of the slicer's selections ( you will need it at the dax that will switch the formula according to your selection)2. Use this formula for the calculation of the running total :
runming total =if(SELECTEDVALUE(Parameter[Month type])="month_num",CALCULATE(
SUM('Table'[Value]),
FILTER( ALLSELECTED('Table'[Month_num]),
'Table'[Month_num]<= MAX(('Table'[Month_num]) )
)),CALCULATE(
SUM('Table'[Value]),
FILTER( ALLSELECTED('Table'[Month]),
'Table'[Month]<= MAX(('Table'[Month]) )
))
)3. On the slicer, use the new column from step 14. Create the matrix (parameter should be on columns)
Result:
PBIX is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- 2 years ago
Hi itsmeanuj
This logic will work for any date format according to your needs, everything is dynamic in my formulas.
I changed your format just because my settings are dd/mm/yyyy , and I didn't want to reset them just for the sample solution 🙂If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- 2 years ago
pls try this
pls try this