Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Cummulative sum of a column based on date filter selected in report

HI,

 

I am new to Power BI and i am trying to write a DAX query to get the below output.

 

This is my report with 2 columns and below month/year and group filter

Filters : Month        Year        Group

Report:

Account    Dollor
1                 30
2                 40
3                 20
4                 20
5                 19

 

Account is from one table and dollor is from another table in my report. I need another column giving cumulative sum of Dollor starting from the first time till the month and year selected.

 

For example :

if account 1 has values 10,20,30 in Jan ,Feb and Mar 2018 and if my filter is Feb 2018 then my column must have value 30 and if my filter is March 2018 then it will be 60.

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create measure like DAX below.

 

Comulative = CALCULATE(SUM(Table2[Dollor]),FILTER(ALLSELECTED(Table1), Table1[Year]=MAX(Table1[Year])&&Table1[Month]<=MAX(Table1[Month])))

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create measure like DAX below.

 

Comulative = CALCULATE(SUM(Table2[Dollor]),FILTER(ALLSELECTED(Table1), Table1[Year]=MAX(Table1[Year])&&Table1[Month]<=MAX(Table1[Month])))

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.