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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
karthik69
Frequent Visitor

Split Column based on Delimiter in to Rows based on the Condition

Hello,

 

Thanks for seeing this Question.

 

I'm trying to find a solution to split column in to rows based on the Value in the Column.

 

In my scenario the text that determines the split is 'New'. if the Column has this text then it should be split in to seperate row and keeping other values/text in Tact.

 

This is the Source Data

karthik69_0-1662092875298.png

I would like to see the Outputs as Below

karthik69_1-1662092924845.png

I did try to include the if condition and there are errors.

Can anyone help me out please.

 

Regards

1 ACCEPTED SOLUTION
MahyarTF
Memorable Member
Memorable Member

Hi,

In Power Query I did copy twice from particular Table :

1- in the first one, 

A- I add Custom Column and use below M code : if Text.Contains([Desc], "New") then "New" else ""

B- Filter the new Column just for the rows including 'New'

C- Remove the Desc Column and rename the new column to Desc

MahyarTF_0-1662096807868.png

 

2- In the second one,

A- I Replace the New with Space for Desc Column

B- Replace ", ," with ","

C- Trim the Desc Column

D- RightTrim the "," from the end 

MahyarTF_1-1662096943895.png

3- Now if Append these two ones together, the new table is included the particular rows :

MahyarTF_2-1662097005644.png

 

Appreciate your Kudos

Mahyartf

View solution in original post

3 REPLIES 3
karthik69
Frequent Visitor

thank you all

MahyarTF
Memorable Member
Memorable Member

Hi,

In Power Query I did copy twice from particular Table :

1- in the first one, 

A- I add Custom Column and use below M code : if Text.Contains([Desc], "New") then "New" else ""

B- Filter the new Column just for the rows including 'New'

C- Remove the Desc Column and rename the new column to Desc

MahyarTF_0-1662096807868.png

 

2- In the second one,

A- I Replace the New with Space for Desc Column

B- Replace ", ," with ","

C- Trim the Desc Column

D- RightTrim the "," from the end 

MahyarTF_1-1662096943895.png

3- Now if Append these two ones together, the new table is included the particular rows :

MahyarTF_2-1662097005644.png

 

Appreciate your Kudos

Mahyartf
Shreeram04
Resolver III
Resolver III

Hi @karthik69 ,

 

Please find the below link for your reference.

 

https://community.powerbi.com/t5/Desktop/Split-column-not-into-seperate-columns-but-in-rows/m-p/1317...

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

Thanks,

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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