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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
egarstad
Frequent Visitor

DAX calc. column that displays the value from one column based on the max value in another column

Hi All,

 

I am new to DAX and have been trying to solve this problem for a few days now with no luck. I have found multiple forum posts with similar requests but none that solve my exact situation.

 

Any help would be much appreciated and thank you in advance!

 

I have the following table containing manufacturing information. An Order #, an Operation # within that Order #, and the Output Qty of that operation:

 

Table.png

 

I would like to add a DAX calculated column that, for every row, displays the Output Qty of the final operation in the order:

 

table1.png

 

I hope that makes sense. It seems like fairly straight forward logic to me but I just cannot come up with a DAX formula that works.

1 ACCEPTED SOLUTION
fhill
Resident Rockstar
Resident Rockstar

See if this works, I'm worried if you have other filters, they may impact the results...

Forrest

 

Qty - Max Op by Order = CALCULATE(
                   SUM(Table1[Qty]),
                            FILTER(Table1, Table1[Op #] = CALCULATE(
                                            MAX(Table1[Op #]),
                                           ALLEXCEPT( Table1, Table1[Order #]))),
                                           Table1[Order #] = EARLIER(Table1[Order #]))

 

image.png




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




View solution in original post

3 REPLIES 3
fhill
Resident Rockstar
Resident Rockstar

See if this works, I'm worried if you have other filters, they may impact the results...

Forrest

 

Qty - Max Op by Order = CALCULATE(
                   SUM(Table1[Qty]),
                            FILTER(Table1, Table1[Op #] = CALCULATE(
                                            MAX(Table1[Op #]),
                                           ALLEXCEPT( Table1, Table1[Order #]))),
                                           Table1[Order #] = EARLIER(Table1[Order #]))

 

image.png




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Hi, how would be the same formula but filling only the rows with the result in the corresponding rows? like this image

Captura.PNG

Works like a charm. Thank you for the quick response!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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