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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
stackover
Frequent Visitor

Running Total wi

Hi all. 

 

I need help with a DAX formula. I searched and tried a lot but I wan not able to create such measure yet.

I need to SUM "value" column where the date in the "Actual" column is the lastest possible, but I must not leave any project aside. If the lastest data in the "Actual" column was a year ago, it must be added too.

This is my DAX, but is not considering the the Project A because the value in the "Actual" column is not the MAX.

 

MH-Baseline = 
VAR mdp = MAX ('Project_Baseline'[Date])
VAR mda = MAX ('Project_Baseline'[Actual])

RETURN CALCULATE ( 
    SUM(Project_Baseline[Value]),
    'Date_List'[Date] <= mdp,
    Project_Baseline[Actual] = mda    
)

 

 

 

This is my database as example.

stackover_1-1709156111172.png

 

The running total should be the SUM of all data in yellow. 

1 ACCEPTED SOLUTION
stackover
Frequent Visitor

Never Mind. I was able to solve the problem using the DAX below.

Value running total in Date = 
VAR _MaxDateInID = CALCULATE(MAX('Project_Baseline'[Actual]),  ALLEXCEPT('Project_Baseline',Project_Baseline[Project ID]))
return CALCULATE(
	SUMX('Project_Baseline',[m1]),
	FILTER(
		ALLSELECTED('Project_Baseline'[Date]),
		ISONORAFTER('Project_Baseline'[Date], MAX('Project_Baseline'[Date]), DESC)
	)
)

View solution in original post

5 REPLIES 5
stackover
Frequent Visitor

Never Mind. I was able to solve the problem using the DAX below.

Value running total in Date = 
VAR _MaxDateInID = CALCULATE(MAX('Project_Baseline'[Actual]),  ALLEXCEPT('Project_Baseline',Project_Baseline[Project ID]))
return CALCULATE(
	SUMX('Project_Baseline',[m1]),
	FILTER(
		ALLSELECTED('Project_Baseline'[Date]),
		ISONORAFTER('Project_Baseline'[Date], MAX('Project_Baseline'[Date]), DESC)
	)
)
stackover
Frequent Visitor

Thanks @Ahmedx and @Anonymous but it is looking weird in the graph. I put my real data table in the .pbix file and the graph does not show a crescent line like in a running total line. As I don't have any negative number, it should be a crescente line, like and near to the orange line as this image below.



stackover_0-1709214338319.png

Here is the link to the pbix file.

 

https://we.tl/t-lpyUCADjtt

Anonymous
Not applicable

Hi @stackover 

 

@Ahmedx  GOOD ANSWER!

 

You can also try the following.

 

Two measures:

maxDate = CALCULATE(MAX([Actual]), ALLEXCEPT(Project_Baseline, Project_Baseline[Project ID]))

 

MH-Baseline = CALCULATE(SUM(Project_Baseline[Value]), FILTER(Project_Baseline, [Actual] = [maxDate]))

 

vxuxinyimsft_0-1709190099501.png

Best Regards,
Yulia Xu

 

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

Ahmedx
Super User
Super User

or try this

 

Ahmedx
Super User
Super User

pls try this

Screenshot_3.pngScreenshot_2.png

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors