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
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
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.