Return label and header for max value
label |
header 1 |
header 2 |
header 3 |
header 4 |
header 5 |
|
label |
header |
Value |
label 1 |
1 |
2 |
3 |
4 |
5 |
|
label 3 |
header 4 |
9 |
label 3 |
6 |
7 |
8 |
9 |
0 |
|
|
|
|
label 5 |
1 |
0 |
3 |
4 |
6 |
|
|
|
|
label 7 |
2 |
3 |
3 |
4 |
2 |
|
|
|
|
label |
header 1 |
header 2 |
header 3 |
header 4 |
header 5 |
|
label |
header |
Value |
label 1 |
1 |
2 |
3 |
4 |
5 |
|
label 3 |
header 4 |
9 |
label 3 |
6 |
7 |
8 |
9 |
0 |
|
label 7 |
header 2 |
9 |
label 5 |
1 |
0 |
3 |
4 |
6 |
|
|
|
|
label 7 |
2 |
9 |
3 |
4 |
2 |
|
|
|
|
Code:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Unpivot = Table.UnpivotOtherColumns(Source, {"label"}, "Attribute", "Value"),
Filter = Table.SelectRows(Unpivot, each ([Value] = List.Max(Unpivot[Value]))),
Ren = Table.RenameColumns(Filter,{{"Attribute", "header"}})
in
Ren
Bookmarks