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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
thatjoey20
Helper II
Helper II

How can I make this measure cumulative

Hello guys, 

Basically I have this measure that calculates the savings related to the avg price of last month. 

So initially I got these measures that composes the equation SAVINGS: 

07M - AVGPRICE = [TotalValue] / [TotalVolume]
 
 
08M - L.M AVGPRICE = CALCULATE
                                                        ([07M - AVGPRICE];DATEADD('Calendar'[Date];-1;MONTH))


09M - AVGDIFF = ([07M - AVGPRICE] - [08M - L.M AVGPRICE])
 
26M - Savings = IF(
    ISBLANK([08M - L.M AVGPRICE]) || ISBLANK([07M - AVGPRICE]);
    0;
    [AVGDIFF] * [TotalVolume]
)  *-1
 
It gives us the value we want, but when I throw this measure in a table, it doesnt sum correctly because as I suposse it is not a cumulative measure. How can I transform it in a cumulative measure? So I can see the total "saved" in a year for example. 
 
 
1 REPLY 1
v-tangjie-msft
Community Support
Community Support

Hi @thatjoey20 ,

 

Place the new measure [measure_total] instead of the old measure [your_measure] as the value in the matrix and observe if the total is correct.

Measure_total =
SUMX(
    SUMMARIZE(
        'Table',
        'Table'[RowName],
        'Table'[ColumnName],
        "total",[your measure]//Your already created measure
    ),
    [total]
)

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors
Top Kudoed Authors