Forum Discussion
Cumulative sum
HI v-amarsh,
If my formula not helpful, can you please share a pbix file with some dummy data and expected results to test?
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi Anonymous
Thanks for your reply. Please find the attached .pbix file. The table on the RHS is the output from the DAX formula.
SUM function used in summarize will always give sum for a group together rather than cumulative progression sum what is expected.
Note : My cumulative sum should stop once it reaches the MAX value found in Resource Plan for that particular period. In this dummy data set, max value is seen for period FY20-P10. This can vary.
I am unable to attach my .pbix here so sending the link for report. Request you to download .pbix from that link.
Thanks
- Anonymous6 years agoNot applicable
Hi v-amarsh,
I can't access your link, can you please upload the sample to 'onedrive for business' and share the link here?
Regards,Xiaoxin Sheng
- v-amarsh6 years agoMicrosoft Employee
Hi Anonymous
I have uplaoded the file to One drive for business and shared with you. Below is the link.
Thanks
- Anonymous6 years agoNot applicable
Hi v-amarsh,
I test the modified formula and it can output the expected result as you shared, please try it if it meets your requirement:
Cumulative Table = SUMMARIZE ( 'Role Master', 'Role Master'[GD SI Role], 'Role Master'[Resource Plan], 'Role Master'[GSI Name], 'Role Master'[Fiscal Year], 'Role Master'[Month], 'Role Master'[Assigned], "MyExpectedOutputColumn", VAR maxMonth = CALCULATE ( MAX ( 'Role Master'[Month] ), FILTER ( ALLSELECTED ( 'Role Master' ), [Assigned] <> BLANK () ), VALUES ( 'Role Master'[Fiscal Year] ), VALUES ( 'Role Master'[GSI Name] ), VALUES ( 'Role Master'[GD SI Role] ) ) RETURN IF ( RIGHT ( [Month], 2 ) < RIGHT ( maxMonth, 2 ), CALCULATE ( SUM ( 'Role Master'[Assigned] ), FILTER ( ALLSELECTED ( 'Role Master' ), RIGHT ( [Month], 2 ) <= RIGHT ( EARLIER ( 'Role Master'[Month] ), 2 ) ), VALUES ( 'Role Master'[Fiscal Year] ), VALUES ( 'Role Master'[GSI Name] ), VALUES ( 'Role Master'[GD SI Role] ) ) ) )Regards,
Xiaoxin Sheng