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
Anonymous
Not applicable

Return column name with highest average for selected columns

Hi Powerbi Community,

 

I'm looking for help with a specific issue I've yet to figure out.

 

I have data that I'm putting together and I have 5 columns with individuals values, for example, they are ranked 1-5.

 

I want to find the average of each column and return the column name with the highest average.  

 

I have tried an index column, but have been unsuccessful in pulling the column name with the highest average into a card.

 

I've included two columns as an example, so if I were to use the average function on each column as a measure, how would I write a measure to bring back the name of the individual column with the highest value.

 

I appreciate any help you may be able to offer!

 

DAXLearning_0-1598126971418.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

Please try follow the steps:

 

1. hold shift select the 2 columns => unpivot in query editor.

unpivot.JPG

 

2. Create the measure to compare the averages, you will need multiple if you have more than 2 columns.

highest = 
var AVG1 = CALCULATE(AVERAGE('Table'[Value]),FILTER('Table',[Attribute]="Column1"))
var AVG2 = CALCULATE(AVERAGE('Table'[Value]),FILTER('Table',[Attribute]="Column2"))
Return
IF(AVG1>AVG2,MAX([Attribute]),MAX([Attribute]))

 


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous 

Please try follow the steps:

 

1. hold shift select the 2 columns => unpivot in query editor.

unpivot.JPG

 

2. Create the measure to compare the averages, you will need multiple if you have more than 2 columns.

highest = 
var AVG1 = CALCULATE(AVERAGE('Table'[Value]),FILTER('Table',[Attribute]="Column1"))
var AVG2 = CALCULATE(AVERAGE('Table'[Value]),FILTER('Table',[Attribute]="Column2"))
Return
IF(AVG1>AVG2,MAX([Attribute]),MAX([Attribute]))

 


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

HI @Anonymous 

Do you need average or the highest value. How do u want to "name of the individual column"?

 

Please paste sample input with all columns and some rows and output based on the sample input you are looking to achieve.

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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
Top Kudoed Authors