Forum Discussion

lundande's avatar
lundande
Frequent Visitor
7 years ago
Solved

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
  • Anonymous's avatar
    Anonymous
    7 years ago

    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

    Good luck!

2 Replies

  • Anonymous's avatar
    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

    Good luck!

    • lundande's avatar
      lundande
      Frequent Visitor

      Perfect! Thanks for the help AClerk :)