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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
thedogspollocks
New Member

How to get contents from columns 7-12 to go under contents in columns 1-6

thedogspollocks_0-1707700162089.png

Hi there,

 

Not sure how to do this without coming up with an error.

 

Would love to learn how to do this for future reference. Spent a couple of hours trying to figure it out myself to no avail. 

 

Thanks in advance for your time and any help provided. 

 

 

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Duplicate your query.  Then in one version select columns 1-6. In the other version select columns 7-12.  Append both queries (as new, if you want).  Disable load for the original queries.

View solution in original post

dufoq3
Super User
Super User

Hi @thedogspollocks,

 

Define how many columns you want to split in 2nd step SplitColumnsBy.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTICYmMgNgFiUyA2A2JzILYAYksgNjQAESCVhkZKsTrDUFMsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t, Column7 = _t, Column8 = _t, Column9 = _t, Column10 = _t, Column11 = _t, Column12 = _t]),
    SplitColumnsBy = 6,
    StepBackToSource = Source,
    Append = Table.Combine(List.Transform(List.Split(Table.ToColumns(StepBackToSource), 6), each Table.FromColumns(_, List.FirstN(Table.ColumnNames(StepBackToSource), SplitColumnsBy))))
in
    Append

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

2 REPLIES 2
dufoq3
Super User
Super User

Hi @thedogspollocks,

 

Define how many columns you want to split in 2nd step SplitColumnsBy.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTICYmMgNgFiUyA2A2JzILYAYksgNjQAESCVhkZKsTrDUFMsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t, Column7 = _t, Column8 = _t, Column9 = _t, Column10 = _t, Column11 = _t, Column12 = _t]),
    SplitColumnsBy = 6,
    StepBackToSource = Source,
    Append = Table.Combine(List.Transform(List.Split(Table.ToColumns(StepBackToSource), 6), each Table.FromColumns(_, List.FirstN(Table.ColumnNames(StepBackToSource), SplitColumnsBy))))
in
    Append

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

lbendlin
Super User
Super User

Duplicate your query.  Then in one version select columns 1-6. In the other version select columns 7-12.  Append both queries (as new, if you want).  Disable load for the original queries.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors