Forum Discussion
6 columns to 3
thank you m_dekorte ,
this is exactly what i need.
I still figuring out how to apply to my Queries tho, becouse i had to do some data cleanup before get the initial structure like you posted (image1)
- m_dekorte3 years agoResident Rockstar
I'm sure we can figure that out BardiMobor
See if these instructions help with implementing it in your query.
Go to your Query and open the Advanced Editor
Copy the first two variables, Cols and SourceNew directly below the let-statement
Now replace ENTER_YOUR_PREVIOUS_STEP_NAME_HERE with the name that follows after the in-clause in your query. Note that there is and needs to be a comma at the end of this line once you've done that.
Now copy everything from the Transform variable all the way to the end (that's the Transform after the in-clause), go back to your query and select the in-clause and all that follows after that - paste this in its place.
Done!
letCols = List.Distinct( List.Transform( Table.ColumnNames( SourceNew ), each Text.Remove(_, { "_", "0".."9"})) ),SourceNew = ENTER_YOUR_PREVIOUS_STEP_NAME_HERE,Transform = Table.Combine(List.Transform(List.Split( Table.ToColumns( SourceNew ), 3),each Table.FromColumns(_, Cols)))inTransformPs. If this helps solve your query please mark this post as Solution, thanks!