Forum Discussion
Cumulative Sum By Month
- 7 years ago
v-yulgu-msftI figured it out. Thank you for looking into this.
I turned the Month Name into Month number and changed the new calculated type to decimal/number.
Month Num = IF(Table1[Month] = "January","1", IF(Table1[Month] = "February","2", IF(Table1[Month] = "March","3", IF(Table1[Month] = "April","4", IF(Table1[Month] = "May","5", IF(Table1[Month] = "June","6", IF(Table1[Month] = "July","7", IF(Table1[Month] = "August","8", IF(Table1[Month] = "September","9", IF(Table1[Month] = "October","10", IF(Table1[Month] = "November","11", IF(Table1[Month] = "December","12"))))))))))))Then, I created a measure
Cumulative = CALCULATE([Total],FILTER(ALLSELECTED(Table1),Table1[Month Num] <= MAX(Table1[Month Num])))
I changed ALL to ALLSELECTED otherwise the value will be static.
Hi Stuznet,
Please show us some sample data of 'Data' table. And what is the formula of [Total]? Besides, show us your desired output in Power BI.
How to Get Your Question Answered Quickly
Best regards,
Yuliana Gu
v-yulgu-msftI figured it out. Thank you for looking into this.
I turned the Month Name into Month number and changed the new calculated type to decimal/number.
Month Num =
IF(Table1[Month] = "January","1",
IF(Table1[Month] = "February","2",
IF(Table1[Month] = "March","3",
IF(Table1[Month] = "April","4",
IF(Table1[Month] = "May","5",
IF(Table1[Month] = "June","6",
IF(Table1[Month] = "July","7",
IF(Table1[Month] = "August","8",
IF(Table1[Month] = "September","9",
IF(Table1[Month] = "October","10",
IF(Table1[Month] = "November","11",
IF(Table1[Month] = "December","12"))))))))))))Then, I created a measure
Cumulative = CALCULATE([Total],FILTER(ALLSELECTED(Table1),Table1[Month Num] <= MAX(Table1[Month Num])))
I changed ALL to ALLSELECTED otherwise the value will be static.
- Anonymous7 years agoNot applicable
Thanks, it is almost can't get the results. AllSelected (Table) Not AllSelected (Table.Column)