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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
BrianPBI37QF
Frequent Visitor

Add new row conditionally

Hi, 

I would like to add new row, Using M Query, for each word after a comma, where all data is the same except for the word after the comma: 

BrianPBI37QF_0-1678313381418.png
Would become:

BrianPBI37QF_1-1678313528197.png

 

1 ACCEPTED SOLUTION
adudani
Memorable Member
Memorable Member

hi @BrianPBI37QF ,

sample input:

 

adudani_1-1678318493632.png

 

 

See output using sample data:

 

 

adudani_2-1678318513993.png

 

the steps are below:

 

 select the column you want to split then:

step1: click on  "Transform" tab.

step2: Select split column by delimiter

step3: select the delimeter ( in this case Comma)
step4: Each occurence of delimiter

step5: choose advanced options, select split into rows. then OK.

adudani_0-1678318302870.png

 

Alterntatively:

 

create a blank query. Copy and paste the code below into the advanced editor:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXLOzy3ISS1JBTKN9Q2M9I0MjIyBbCN9A2MY29nfN8AvBMjw9AsOcfTxAbJ8XZ09dOCEUqxOtJITHsMskDg4TFOKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [part = _t, status = _t, date = _t, date2 = _t, column1 = _t, column2 = _t, column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"part", type text}, {"status", type text}, {"date", type date}, {"date2", type text}, {"column1", type text}, {"column2", type text}, {"column3", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"column3", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "column3")
in
    #"Split Column by Delimiter"

 

 

 

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

View solution in original post

1 REPLY 1
adudani
Memorable Member
Memorable Member

hi @BrianPBI37QF ,

sample input:

 

adudani_1-1678318493632.png

 

 

See output using sample data:

 

 

adudani_2-1678318513993.png

 

the steps are below:

 

 select the column you want to split then:

step1: click on  "Transform" tab.

step2: Select split column by delimiter

step3: select the delimeter ( in this case Comma)
step4: Each occurence of delimiter

step5: choose advanced options, select split into rows. then OK.

adudani_0-1678318302870.png

 

Alterntatively:

 

create a blank query. Copy and paste the code below into the advanced editor:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXLOzy3ISS1JBTKN9Q2M9I0MjIyBbCN9A2MY29nfN8AvBMjw9AsOcfTxAbJ8XZ09dOCEUqxOtJITHsMskDg4TFOKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [part = _t, status = _t, date = _t, date2 = _t, column1 = _t, column2 = _t, column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"part", type text}, {"status", type text}, {"date", type date}, {"date2", type text}, {"column1", type text}, {"column2", type text}, {"column3", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"column3", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "column3")
in
    #"Split Column by Delimiter"

 

 

 

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.