Forum Discussion
Cumulative total in stacked bar graph
- 6 years ago
Hi Anonymous ,
Here is my sample data.
1. Create three calculated columns to sort the months of the chart by year.
Month = MONTH([Date]) Year = YEAR([Date]) Year-Month = [Year]&"-"&[Month]2. You can write your measure as below. I changed ALLSELECTED to ALLEXCEPT.
Running Total MEASURE = CALCULATE ( SUM ( 'Data'[Savings] ), FILTER ( ALLEXCEPT ( Data, Data[Categories] ), Data[Date] <= MAX ( Data[Date] ) ) )You can check more details from here.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Here is my sample data.
1. Create three calculated columns to sort the months of the chart by year.
Month = MONTH([Date])
Year = YEAR([Date])
Year-Month = [Year]&"-"&[Month]
2. You can write your measure as below. I changed ALLSELECTED to ALLEXCEPT.
Running Total MEASURE =
CALCULATE (
SUM ( 'Data'[Savings] ),
FILTER (
ALLEXCEPT ( Data, Data[Categories] ),
Data[Date] <= MAX ( Data[Date] )
)
)
You can check more details from here.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This solution works. Though if you have a calendar table, be sure to mind the differences below. Also, note the difference in the CALCULATE function's first operand - This is the solution to overcounting which you may or may not encounter.
/* 1. Keep all days in the Calendar table, then
2. Keep only those up to the last visible day */