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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lundande
Frequent Visitor

Return a column header based on the rows minimum value

I am new to PowerBI... I am struggling to figure out a way to return a column header based on the minimum value within that row. Can anyone help me with this?

 

 ApplePearGrape  Minimum (Calculated)Returned Value
A123      1Apple
B654      4Grape
C879      7Pear
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lundande 
For the minimum column.

  1. Go to Edit Queries > Add column menu item > Statistics (Minimum).

For the second part

  1. Then Choose all columns but the minimum and under transform menu item click unpivot selected columns.
  2. Create a visual table. Add a column that returns the minimum fruit name
Returned Value = IF(Fruits[Minimum] = Fruits[Value],Fruits[Attribute],"N/A")
Then you can filter the table, depends on your needs. Here I filtered out N/A

2019-04-18 08_41_45-papercut - Remote Desktop Connection.png

Good luck!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @lundande 
For the minimum column.

  1. Go to Edit Queries > Add column menu item > Statistics (Minimum).

For the second part

  1. Then Choose all columns but the minimum and under transform menu item click unpivot selected columns.
  2. Create a visual table. Add a column that returns the minimum fruit name
Returned Value = IF(Fruits[Minimum] = Fruits[Value],Fruits[Attribute],"N/A")
Then you can filter the table, depends on your needs. Here I filtered out N/A

2019-04-18 08_41_45-papercut - Remote Desktop Connection.png

Good luck!

Perfect! Thanks for the help AClerk 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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