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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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