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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Foxxon28
Helper I
Helper I

Cumulative Sales Sum based on Specific Column and Rule

Dear reader,

 

I have a dataset as follows:

 

YearDate ( Once Per Month )Month_progressSales
202430-11-2023-110
202431-12-2023020
202431-01-2024130
202330-11-2022-115
202331-12-2022025
202331-01-2023135

 

What I want to create is a line chart with the Cumu. Sales on the Y axis and the Month_Progress on the X axis (filtered by >= 0).
For each year I show a different line.

What I want to calculate is the cumulative sales, based on the year, where the cumulation should include every month_progress, also the ones < 0

 

Expected result: 

Foxxon28_0-1713457551513.png

Red line (2024) Month 0 = 10 + 20 
Blue line (2023) Month 1 = 15 + 25 +35 

 

What type of measure do I need to write for this?

I would like to hear from you.

 

Kind regards,

Daniël

1 ACCEPTED SOLUTION

@Foxxon28 PBIX is attached below signature.

Sales Measure = 
    VAR __MP = MAX('Table'[Month_progress])
    VAR __Year = MAX('Table'[Year])
    VAR __Table = FILTER(ALL('Table'), [Month_progress] <= __MP && [Year] = __Year)
    VAR __Result = SUMX(__Table, [Sales])
RETURN
    __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

When does the FY start?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Community Champion
Community Champion

@Foxxon28 Better Running Total - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler I've tried a few things, but have yet to come up with a working measure. Could you help me out here with my given date sample.

 

Would like to hear from you.

Daniël

@Foxxon28 PBIX is attached below signature.

Sales Measure = 
    VAR __MP = MAX('Table'[Month_progress])
    VAR __Year = MAX('Table'[Year])
    VAR __Table = FILTER(ALL('Table'), [Month_progress] <= __MP && [Year] = __Year)
    VAR __Result = SUMX(__Table, [Sales])
RETURN
    __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.