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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Bauhaus-Arti
Frequent Visitor

Highest value by column

Hi everybody,

 

I'm stuck at the following problem. I have to select the highest score out of six columns and return the column name of the highest score. The table should look like this:

R1R2R3R4R5R6Highest
94941181097485R3
10810512883721066R6

 

I hope someone can help me with this problem.

 

Thank you! 🙂

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Bauhaus-Arti you can try nested if function like below to get maximum value

Maximum = MAX('Table'[R1],MAX('Table'[R2],MAX('Table'[R3],MAX('Table'[R4],MAX('Table'[R5],'Table'[R6])))))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Bauhaus-Arti Please click on edit query 

click on add column tab
Select all columns from R1 to R6
Click on statistics dropdown and select maximum (This will give you maximum value from selected columns)
now close and apply
Create a calculated column using switch statement to get the column name

Column = 
SWITCH(TRUE()
            ,'Table'[Maximum]='Table'[R1],"R1"
            ,'Table'[Maximum]='Table'[R2],"R2"
            ,'Table'[Maximum]='Table'[R3],"R3"
            ,'Table'[Maximum]='Table'[R4],"R4"
            ,'Table'[Maximum]='Table'[R5],"R5"
            ,'Table'[Maximum]='Table'[R6],"R6"
            ,"none")

  

@Anonymous They dont show up in the query editor because R1 to R6 are calculated columns. Any idea how i can fix this?

 

Anonymous
Not applicable

@Bauhaus-Arti you can try nested if function like below to get maximum value

Maximum = MAX('Table'[R1],MAX('Table'[R2],MAX('Table'[R3],MAX('Table'[R4],MAX('Table'[R5],'Table'[R6])))))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors