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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Incorrect Running Total based on Measure

I have a measure that calculates a value daily, and I'm trying to get a running total of that value.

 

My baseline measure is in the middle column; that's the value I'd like a running total for.

 

Capture4.PNG

 

Here's the DAX for my running total column:

 

AUM DifferenceDailyDiscountedCFs $ RT =
VAR MaxDate = MAX(DailyAssets[as_of_date])
RETURN
CALCULATE(
[AUM DifferenceDailyDiscountedCFs $],
DailyAssets[as_of_date] <= MaxDate,
ALL(DailyAssets[as_of_date]))
 
In the image above, I'd expect the RT column to return -$286,940.50, followed by -$923,368.19 (derived from -$286,940.50 + -$636,427.69).
 
Please help.. Thanks!
5 REPLIES 5
CNENFRNL
Community Champion
Community Champion

@Anonymous , why not attach your pbix file for a quick troubleshooting; such a running total issue isn't supposed to be that complicated.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Unfortunately, I'm not able to attach the file for security reasons.

Anonymous
Not applicable

@Anonymous 

 

If you can't attach it for security reasons.... then create a file with meaningless data that will re-create the issue and then attach it. Simple.

Fowmy
Super User
Super User

@Anonymous 

Have you got a date table in your model and created a correct relationship??

In your formula, you have assigned the [as of date] column but the screenshot shows you have used the [Date] column. Either use the correct date column or modify your formula:

AUM DifferenceDailyDiscountedCFs $ RT = 
VAR MaxDate =  MAX(DailyAssets[as_of_date])
RETURN
CALCULATE(
    [AUM DifferenceDailyDiscountedCFs $],
    DailyAssets[as_of_date] <= MaxDate,
    ALL(DailyAssets[as_of_date])
)

If you are using the date table then,

 

AUM DifferenceDailyDiscountedCFs $ RT = 
VAR MaxDate =  MAX(Dates[Date])
RETURN
CALCULATE(
    [AUM DifferenceDailyDiscountedCFs $],
    Dates[Date] <= MaxDate,
    ALL(Dates[Date])
)



________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Good catch, but still returning incorrect result unfortunately. Updated measure:

 

AUM DifferenceDailyDiscountedCFs $ RT =
VAR MaxDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
[AUM DifferenceDailyDiscountedCFs $],
'Calendar'[Date] <= MaxDate,
ALL('Calendar'[Date]))

 

Output:

Capture7.PNG

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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