Forum Discussion
Running Total in Matrix
Hi All,
i could able to achieve sum of ll the months.
Provided the example for "sum" of all the columns and we are showing that in right hand side.
Is it possible to have running total? Provided the sample output below
Thanks in Advance
Prakash
Hi Anonymous
Try something like this.
Sales RT = IF( NOT ISEMPTY( 'Table' ), VAR __maxDate = MAX( 'Calendar'[Date] ) RETURN CALCULATE( [Sales], 'Calendar'[Date] <= __maxDate, ALL( 'Calendar' ) ) )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
8 Replies
- v-alq-msftCommunity Support
Hi, Anonymous
Based on your description, I created data to reproduce your scenario.
Table:
Then you may create a calculated table and build a one-to-many relationship between two tables as follows.
Date Table = CALENDARAUTO()You can create a measure as below.
Running Total =CALCULATE(SUM('Table'[Value]),DATESYTD('Date Table'[Date]))Finally, you may use matrix visual to show the reslut:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- amitchandakSuper User
If you create a running total over month and add that to matrix it should work ?
Please refer
https://community.powerbi.com/t5/Desktop/Cumulative-Total/td-p/43115
https://www.daxpatterns.com/cumulative-total/
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners/ba-p/890814
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p/881739
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601 - MariuszCommunity Champion
Hi Anonymous
Try something like this.
Sales RT = IF( NOT ISEMPTY( 'Table' ), VAR __maxDate = MAX( 'Calendar'[Date] ) RETURN CALCULATE( [Sales], 'Calendar'[Date] <= __maxDate, ALL( 'Calendar' ) ) )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.- AnonymousNot applicable
Hi Mariusz ,
Can we achieve this without the help of calendar table?
Thanks.
Also any help n the below would be helpful
- MariuszCommunity Champion
Hi Anonymous
You can replace Calendar Date column with a date column Comming from your table, but using a Date Dimension / Calendar Table is considered the best practice.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.