cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thomas94401
Frequent Visitor

Cumulative values

Hello,

I have a problem with the cumulative values.

I have built a measure that allows me to display the cumulative values month by month.

The question is: I would like, when I filter on a month, that the map gives me the value of the cumulative measure for this month, and not the value of this month not cumulated

Thanks in advance for your help!

 

Thomas94401_0-1652999586798.png

87 is the sum of the last cumulated values of France and Germany

 

Thomas94401_1-1652999994985.png

When I click on the curve for Germany in the second month, I would like it to show me 22 instead of 12 (which is the non-cumulative value of the second month)

 

My measure is 

 

Cumulative number =
CALCULATE(
SUM('Table'[Number]),
FILTER(
ALLSELECTED('Table'[Month]),
'Table'[Month] <= MAX('Table'[Month])
)
)

 

 

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Thomas94401 

 

Try this:

Cumulative number =
VAR _Max =
    MAX ( 'Table'[Month] )
RETURN
    CALCULATE (
        SUM ( 'Table'[Number] ),
        FILTER ( ALL ( 'Table'), 'Table'[Month] <= _Max )
    )

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

Hi @Thomas94401 

 

Try this:

Cumulative number =
VAR _Max =
    MAX ( 'Table'[Month] )
RETURN
    CALCULATE (
        SUM ( 'Table'[Number] ),
        FILTER ( ALL ( 'Table'), 'Table'[Month] <= _Max )
    )

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors