Forum Discussion
Running Total / Cummulative totals
- Anonymous2 years ago
Hi rp2022 ,
Please create a new calculated column:Group = VAR __cur_label = 'Table'[Label] VAR __group = IF(ISERROR(VALUE(__cur_label)),__cur_label,"Date") RETURN __groupAnd then please create a new measure:
Running Total = VAR __group = MAX('Table'[Group]) VAR __cur_date = MAX('Table'[Date]) VAR __result = CALCULATE(SUM('Table'[$]),FILTER(ALLSELECTED('Table'),'Table'[Group]=__group && 'Table'[Date]<=__cur_date)) RETURN __resultOutput:
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi rp2022 ,
Please create a new calculated column:
Group =
VAR __cur_label = 'Table'[Label]
VAR __group = IF(ISERROR(VALUE(__cur_label)),__cur_label,"Date")
RETURN
__group
And then please create a new measure:
Running Total =
VAR __group = MAX('Table'[Group])
VAR __cur_date = MAX('Table'[Date])
VAR __result = CALCULATE(SUM('Table'[$]),FILTER(ALLSELECTED('Table'),'Table'[Group]=__group && 'Table'[Date]<=__cur_date))
RETURN
__result
Output:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Works like a charm, thank you so much