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