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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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