cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
FelipeJaworoski
Frequent Visitor

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}))

Thank you so much!

ronrsnfld
Resident Rockstar
Resident Rockstar

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

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors