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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.