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
polanddm
Regular Visitor

Constrained Running Total

Hi all, my first post/question! 

 

New to Power BI, enjoying learning.

 

I have a single table data model that has columns like this:

 

Stuf...Type....Value...Data...Stuff

 

For each "Type", I have a serveral Value and Date pairs associated.

 

What I would like to be able to do is create a "CumulativeValue" measure so that I can chart this information in a Line Chart (where each "Type" is a Legend entry).

 

I have seen DAX like this:

 
CumulativeX = CALCULATE(Table[X],filter(all(Table[Date]), Table[Date] <= max(Table[Date])))
 
However, this is not precisely what I am after as the *date range* for each distinct Type of data is different.
 
What I would like to be able to do is accumulate a running total for a Value that honors the max Date for each Type.
 

I would really appreciate any suggestions or pointers on how to do this!

 

Thanks,

 

Doug

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @polanddm 

 

Try something like this

CumulativeX =
CALCULATE (
    [X],
    FILTER ( 
        ALLEXCEPT( Table, Table[Type] ), 
        Table[Date] <= MAX ( Table[Date] ) 
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @polanddm 

 

Try something like this

CumulativeX =
CALCULATE (
    [X],
    FILTER ( 
        ALLEXCEPT( Table, Table[Type] ), 
        Table[Date] <= MAX ( Table[Date] ) 
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Many thanks Mariusz!

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.