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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
jcastr02
Post Prodigy
Post Prodigy

get column header for max column

I have below "DE MAX" column that gets the maxiumum value in the row.  I'd like to be able to get the column name of the item where the max value was found.  At times the max value may be shared between two values.  See below Desired result column.  Any help is appreciated.  Id like to be able to do this in PQ.

StoreDE/F1 BaseDE/F1 HTSDE/F1 Patient ExperienceDE Special Projects and Temp SupportDE MAXDESIRED RESULT
24921.30.151.451.31.45DE/F1 Patient Experience
51031.3nullnull1.31.3DE Special Projects and Temp Support; DE/F1 Base
53881.3nullnull1.31.3DE Special Projects and Temp Support; DE/F1 Base
54441.3nullnull1.31.3DE Special Projects and Temp Support; DE/F1 Base
93131.30.15null1.31.3DE Special Projects and Temp Support; DE/F1 Base
51841.3null0.61.31.3DE/F1 Patient Experience
1 ACCEPTED SOLUTION
spinfuzer
Solution Sage
Solution Sage

You can add custom column.  I am not sure how the last one does not include base.

 

Text.Combine(List.RemoveItems(List.Transform(List.PositionOf(Record.ToList(_),[DE MAX], Occurrence.All), (x) => Record.FieldNames(_){x}), {"DE MAX"}),";")

View solution in original post

2 REPLIES 2
spinfuzer
Solution Sage
Solution Sage

You can add custom column.  I am not sure how the last one does not include base.

 

Text.Combine(List.RemoveItems(List.Transform(List.PositionOf(Record.ToList(_),[DE MAX], Occurrence.All), (x) => Record.FieldNames(_){x}), {"DE MAX"}),";")

Thank you This worked, sorry that last row was a mistake on my part base would have been included

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors