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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Pallavi_m
Helper I
Helper I

Cumulative monthly totals

Hi,

I have a Date table and fact table related by field called Year

I want to achieve a table like this:

YearMonthNosalesMonthly Cumulative
2022012020
2022023050
2022034090
20220450140

I have used this dax to obtain this measure Monthly cumulative:

 

Monthly cumulative=
calculate(sum(sales),
filter(allselected('Date'),
'Date'[Dates]<=Max('Date'[Dates])))

 

But the result is 

140

140

140

140

I want to this in a bar graph too.

How do i do this?

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.

 

Monthly cumulative =
CALCULATE (
    SUM ( sales[revenue] ),
    FILTER ( ALLSELECTED ( 'Date'[Dates] ), 'Date'[Dates] <= MAX ( 'Date'[Dates] ) )
)


Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question





View solution in original post

Mahesh0016
Super User
Super User

Mahesh0016_0-1671087153889.png

Monthly cumulative =
calculate(sum(fact_table[Sales]),
filter(allselected('fact_table'),
'fact_table'[Month]<=Max('fact_table'[Month])))

 

 

please check your relationship of date and sale table and also filter direction of table.

View solution in original post

3 REPLIES 3
Pallavi_m
Helper I
Helper I

Thanks guys. I got the answer when I was just posting this question. However, the reply button deactivated, when I want to say.. I got the answer.

Thanks again for looking into it.

Mahesh0016
Super User
Super User

Mahesh0016_0-1671087153889.png

Monthly cumulative =
calculate(sum(fact_table[Sales]),
filter(allselected('fact_table'),
'fact_table'[Month]<=Max('fact_table'[Month])))

 

 

please check your relationship of date and sale table and also filter direction of table.

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.

 

Monthly cumulative =
CALCULATE (
    SUM ( sales[revenue] ),
    FILTER ( ALLSELECTED ( 'Date'[Dates] ), 'Date'[Dates] <= MAX ( 'Date'[Dates] ) )
)


Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question





Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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