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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
alonc
Regular Visitor

Split cell into rows base on line feed carriage return is not working

Hello 

I have a column type Text, where cells may contain several values:

Text1
Text2
Text3

 
Text1
Text2

 

I'm using the split by delimiter and it is not working, meaning the cells aren not splitted

alonc_1-1710855719725.png

Can someone assist me?

 

1 ACCEPTED SOLUTION

It works with #(lf)

 

I've connected query to your google drive link:

 

v1

 

let
    Source = Web.Contents("https://drive.google.com/uc?export=download&id=107-v_GTess0mdB25dfazed5f_OVWRKt3"),
    Content = Excel.Workbook(Source),
    Table1_2_Table = Content{[Item="Table1_2",Kind="Table"]}[Data],
    #"Split Column by Delimiter" = Table.SplitColumn(Table1_2_Table, "Session name/s", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), {"Session name/s.1", "Session name/s.2", "Session name/s.3", "Session name/s.4", "Session name/s.5", "Session name/s.6", "Session name/s.7", "Session name/s.8", "Session name/s.9", "Session name/s.10", "Session name/s.11", "Session name/s.12", "Session name/s.13", "Session name/s.14", "Session name/s.15", "Session name/s.16"})
in
    #"Split Column by Delimiter"

 

v2 same as wathinnc's

let
    Source = Web.Contents("https://drive.google.com/uc?export=download&id=107-v_GTess0mdB25dfazed5f_OVWRKt3"),
    Content = Excel.Workbook(Source),
    Data = Content{[Item="Table1_2",Kind="Table"]}[Data],
    Transformed = Table.ExpandListColumn(Table.TransformColumns(Data, {{ "Session name/s", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv) }}), "Session name/s")
in
    Transformed

 


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

6 REPLIES 6
watkinnc
Super User
Super User

Splitting by just line feed worked for me.  The formula produced by Power Query was:

 

= Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Session name/s", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Session name/s")

watkinnc_0-1710860954257.png

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
dufoq3
Super User
Super User

Hi @alonc, I see that you've selected only Line Feed #(lf), try to select Carriage Return and Line Feed #(cr)#(lf).


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

I tried this, it is not working.

I also thought maybe the problem is that some of the values are null or empty

So, I filtered those values, still not working 🙁

Could you upload your file i.e. to google drive and share a link with us? (Don't forget to set public permissions), because #(lf) works with your example...


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

It works with #(lf)

 

I've connected query to your google drive link:

 

v1

 

let
    Source = Web.Contents("https://drive.google.com/uc?export=download&id=107-v_GTess0mdB25dfazed5f_OVWRKt3"),
    Content = Excel.Workbook(Source),
    Table1_2_Table = Content{[Item="Table1_2",Kind="Table"]}[Data],
    #"Split Column by Delimiter" = Table.SplitColumn(Table1_2_Table, "Session name/s", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), {"Session name/s.1", "Session name/s.2", "Session name/s.3", "Session name/s.4", "Session name/s.5", "Session name/s.6", "Session name/s.7", "Session name/s.8", "Session name/s.9", "Session name/s.10", "Session name/s.11", "Session name/s.12", "Session name/s.13", "Session name/s.14", "Session name/s.15", "Session name/s.16"})
in
    #"Split Column by Delimiter"

 

v2 same as wathinnc's

let
    Source = Web.Contents("https://drive.google.com/uc?export=download&id=107-v_GTess0mdB25dfazed5f_OVWRKt3"),
    Content = Excel.Workbook(Source),
    Data = Content{[Item="Table1_2",Kind="Table"]}[Data],
    Transformed = Table.ExpandListColumn(Table.TransformColumns(Data, {{ "Session name/s", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv) }}), "Session name/s")
in
    Transformed

 


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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors