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
oneillp111
Frequent Visitor

Cumulative matrix measure

I am trying to create a measure that will do a cumulative total within the matrix.  Below is a snipit of the data, the 

example.pngexample2.png

The measure would give me the sum of the value and the value before it so for the first column it would be

4

6

10

instead of

4

2

4

I tried to do it with the following measure that I found in this forum but it sums everything in the table without taking into account filters on the page. The Sum MQ field is just a 1 so i could use sum instead of count.

 

Running MQ Sum = CALCULATE(sum('Data'[sum MQ]),filter('Data','Data'[Created on]<=EARLIER('Data'[Created on])))

 

 

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @oneillp111 

You need to create an index column  in "Transform Data" after sorting by date and MQ in ascending order.

Then please try measure as below:

Measure =
CALCULATE (
    SUM ( Data[sum MQ] ),
    FILTER (
        ALL ( Data ),
        Data[Index] <= MAX ( Data[Index] )
            && Data[Created on] = MAX ( Data[Created on] )
    )
)

Then result will show as below:

35.png

 

Please check attached pbix for more detail.

If it doesn't meet your requirement,please share more details.

 

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@oneillp111 , try like


Running MQ Sum = CALCULATE(sum('Data'[sum MQ]),filter('Data','Data'[fail MQ]<=max('Data'[fail MQ])))

or

Running MQ Sum = CALCULATE(sum('Data'[sum MQ]),filter(allselected('Data'),'Data'[fail MQ]<=max('Data'[fail MQ]) && 'Data'[Helper2] =max('Data'[Helper2])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.