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
anbose
Frequent Visitor

count number of lines and separate them into two columns

Hii, I'm new to powerbi. For the below table, for each cutomer Id, I want to split the "Alerts" column into two columns based on position of the line. The odd ones should get stored into Alerts1 and even ones into Alerts2. I'm not able to do this. Can anyone help me with this. Thank you.

anbose_0-1685887428607.png

 

1 ACCEPTED SOLUTION

=Table.SplitColumn(PreviousStepName,"Alers",each List.Transform(List.Zip(List.Split(Text.Split(_,"#(lf)"),2)),each Text.Combine(_,"#(lf)")),{"Alerts1","Alerts2"})

View solution in original post

4 REPLIES 4
wdx223_Daniel
Super User
Super User

=Table.SplitColumn(PreviousStepName,"Alers",each List.Transform(List.Zip(List.Split(Text.Split(_,"#(lf)"),2)),eacth Text.Combine(_,"#(lf)"),{"Alerts1","Alerts2"})

Hii, Thanks for your reply. After applying this formula, I'm getting this below error.
Expression.Error: 3 arguments were passed to a function which expects 2.
Details:
Pattern=
Arguments=[List]
Can you please tell me why it is coming? Thank you

=Table.SplitColumn(PreviousStepName,"Alers",each List.Transform(List.Zip(List.Split(Text.Split(_,"#(lf)"),2)),each Text.Combine(_,"#(lf)")),{"Alerts1","Alerts2"})

Thank you so much. It worked.

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.