Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
bjurek
Helper I
Helper I

transforming date pivot

Hello !
Does anybody have any idea how to twist the dataset like below?
The number of columns in the input is dynamic.

1.png

 

1 REPLY 1
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1661933551130.png

= 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(_,"-")))))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.