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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Running total calculations of maximum value only of column 1 per distinct column-value of column 2

Hello, 

 

I've been trying to calculate the running total of my dataset for a while now without any luck.
The data looks like this: 

Vincentvbc_1-1603280394942.png

 

So the formula should perform a running total calculation of the maximum value only for column "SHEET_COUNT" for every distinct production order (column = PRODUCTION_ORDER). This should be calculated for every datetime value in my dataset as we want to plot it in a visual. 


The CumSumSheetCount column is where i'm at at the moment.

It's formula looks like this: 

Vincentvbc_2-1603280609669.png

 

However this is not giving the desired output as that would be 34 (= only one PO with max 34), 35 (=max of first PO + max of second PO = 34 +1), 36 (=max of first PO + max of second PO = 34 +2) , 37 (=max of first PO + max of second PO = 34 +3),.. 

I know I could play around with count() however I will have to do the same calculation for JOINT_COUNT and this is, as you can see, not every time +1.

Also: the data source of this report is a push dataset, meaning I am only able to use measures. 

Any help would be very appreciated. 

 

Vincent

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try like

 

Cumm Sales = CALCULATE(SUM(Table[Sheet Count]),filter(allselected(Table),Table[datetime] <=max(Table[datetime])))

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

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
Anonymous
Not applicable

@amitchandak , this would sum every value of the dataset, however I only want it to add the maximum value of every distinct PRODUCTION_ORDER

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.