Source |
|
|
|
|
|
|
Result |
|
|
|
|
NAME |
Good at subject A |
Good at subject B |
Good at subject C |
Good at subject D |
Good at subject E |
|
language |
math |
English |
history |
geography |
ABC |
language |
math |
English |
history |
geography |
|
ABC |
ABC |
ABC |
ABC |
ABC |
CDE |
math |
geography |
|
|
|
|
HIJ |
CDE |
EFG |
EFG |
CDE |
EFG |
English |
math |
history |
|
|
|
|
EFG |
|
HIJ |
HIJ |
HIJ |
history |
geography |
language |
math |
|
|
|
HIJ |
|
XYZ |
|
XYZ |
math |
history |
|
|
|
|
|
XYZ |
|
|
|
Code:
// Query1
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
UOC = Table.UnpivotOtherColumns(Source, {"NAME"}, "Attribute", "Value"),
Grp = Table.Group(UOC, {"Value"}, {{"Count", each [NAME]}}),
Result = Table.FromColumns(Grp[Count],Grp[Value])
in
Result
Bookmarks