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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors