Forum Discussion
lundande
7 years agoFrequent 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?
| Apple | Pear | Grape | Minimum (Calculated) | Returned Value | |
| A | 1 | 2 | 3 | 1 | Apple |
| B | 6 | 5 | 4 | 4 | Grape |
| C | 8 | 7 | 9 | 7 | Pear |
- Anonymous7 years ago
Hi lundande
For the minimum column.- Go to Edit Queries > Add column menu item > Statistics (Minimum).
For the second part
- Then Choose all columns but the minimum and under transform menu item click unpivot selected columns.
- 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/AGood luck!
2 Replies
- AnonymousNot applicable
Hi lundande
For the minimum column.- Go to Edit Queries > Add column menu item > Statistics (Minimum).
For the second part
- Then Choose all columns but the minimum and under transform menu item click unpivot selected columns.
- 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/AGood luck!
- lundandeFrequent Visitor
Perfect! Thanks for the help AClerk :)