Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (14 sloc) 628 Bytes
(Source as table
,PivotCol as text
,ValueCol as text)=>
let
Source = Table.Buffer(Source) //As source table is referenced 3 times
,GroupClustIndex = Table.Group(Source
,List.RemoveItems(Table.ColumnNames(Source),{ValueCol})
,{"ColOfTables"
,each Table.AddIndexColumn(_,"idx")})
,CombineTables = Table.Combine(GroupClustIndex[ColOfTables])
,Pivot = Table.Pivot(CombineTables, List.Distinct(Table.Column(Source,PivotCol)), PivotCol, ValueCol)
,RemoveIndex = Table.RemoveColumns(Pivot,{"idx"})
in
RemoveIndex
You can’t perform that action at this time.