Forum Discussion
Anonymous
6 years agoNot applicable
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...
- 6 years ago
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.
Anonymous
6 years agoNot applicable
Hi Mariusz ,
Can we achieve this without the help of calendar table?
Thanks.
Also any help n the below would be helpful
Mariusz
6 years agoCommunity 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.
Mariusz
If this post helps, then please consider Accepting it as the solution.
- Anonymous6 years agoNot applicable
Hi Mariusz
I changed as per your suggestion but it is not working.
Sales RT = IF( NOT ISEMPTY( 'Table' ), VAR __maxDate = MAX( 'Table'[Date] ) RETURN CALCULATE( [Sales], 'Table'[Date] <= __maxDate, ALL( 'Table' ) ) )The counts are not matching.
Thanks
- Anonymous6 years agoNot applicable
Hi,
Mariusz Thanks for your help.
Actually i forgot to put AllExcept. Now it is woking fine
Sales RT = IF( NOT ISEMPTY( 'Table' ), VAR __maxDate = MAX( 'Table'[Date] ) RETURN CALCULATE( [Sales], 'Table'[Date] <= __maxDate, ALLExcept( 'Table','Table'[Source System] ) ) )- Anonymous6 years agoNot applicable
Hi Mariusz
I would like to have a rollin 3 months average. will the below code is good? or do we have any better way?
Sales RT = IF( NOT ISEMPTY( 'Table' ), VAR __maxDate = MAX( 'Table'[Date] ) VAR __minDate = MIN( 'Table'[Date] )-90 RETURN CALCULATE( [Sales], 'Table'[Date] <= __maxDate,'Table'[Date] >= __minDate, ALLExcept( 'Table','Table'[Source System] ) ) )Thanks