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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Rearrange Data table

Hi, I'm trying to rearrange my data table on Power Query, but i don't know how to do it.

My data looks like this:

 

FelipeJaworoski_0-1663089288473.png

 

And i want it to rearrange it to look like this:

 

FelipeJaworoski_1-1663089529703.png

 

So, basically, I want to make only 4 columns with the type (Trabalho), Year, Month and values.

 

Can somebody help me? Please! I'm stuck in this for a week!

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

=#table(4,List.TransformMany(Table.ToColumns(PreviousStepName),each List.Skip(_,3),(x,y)=>List.FirstN(x,3)&{y}))

View solution in original post

4 REPLIES 4
wdx223_Daniel
Super User
Super User

=#table(4,List.TransformMany(Table.ToColumns(PreviousStepName),each List.Skip(_,3),(x,y)=>List.FirstN(x,3)&{y}))

Anonymous
Not applicable

Thank you so much!

ronrsnfld
Super User
Super User

Please post your data as text, which can be copy/pasted.

Anonymous
Not applicable

Sorry! It can be like this?

 

Column1 Column2 Column3 Column4 Column5
TRABALHO TRABALHO TRABALHO TRABALHO TRABALHO
2022 2022 2022 2022 2022
Mar Abr Mai Jun Jul
627 618 426 594 871
484 875 487 47 656
392 641 428 19 724
757 660 824 59 580
206 468 923 369 345
536 709 337 215 834
643 406 924 435 332
836 413 379 64 687
102 249 712 599 857
201 237 856 829 382
617 650 594 40 571
601 1 116 805 770
507 143 702 799 259
355 54 705 627 522
204 533 120 419 861
498 283 303 764 612
532 889 941 546 572
611 213 850 513 975
792 171 38 848 530
973 393 14 214 831

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors