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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Super User
Super User

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
Super User
Super User

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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