The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello !
Does anybody have any idea how to twist the dataset like below?
The number of columns in the input is dynamic.
= let items={{"1","red"},{"2","green"},{"3","blue"},{"4","yellow"}},pos=List.Positions(items) in #table(2,List.Transform({1..Number.Power(2,List.Count(items))-1},each List.Accumulate(pos,{null,null},(x,y)=>let a=Number.BitwiseAnd(Number.BitwiseShiftRight(_,y),1) in List.Transform(List.Zip({List.ReplaceValue(x,"",null,Replacer.ReplaceValue),{{null,null},items{y}}{a}}),each Text.Combine(_,"-")))))