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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jay_patel
Helper IV
Helper IV

Want comma seperated value just below (in next line) of earlier one but in the same cell.

Hello All,

Is it possible to get CSV in same cell but in next line.

Ex:

1) 250 mg, 2) 500 mg

 

to 

1) 250 mg
2) 500 mg

 

Thanks In Advance.

3 REPLIES 3
amitchandak
Super User
Super User

@jay_patel , Power query split by delimiter into rows https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

Power Query Split Column , Split Column By Delimiter: https://youtu.be/FyO9Vmhcfag

 

Hi @amitchandak 

I refered above mentioned link by you, but still unable to find solution for the same.
Required : CSV into new line but in same cell, it is possible to replace comma with enter?
  

@jay_patel , a little different approach than use power query replace,

Create replace with #(cr) , and make sure it looks like below
or replace that once you get the code

Table.ReplaceValue(#"Changed Type",",","#(cr)",Replacer.ReplaceText,{"Column1"})

.

 

full Table code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtRUMDI1UMhN11Ew0lQwNQAxlXSUlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type",",","#(cr)",Replacer.ReplaceText,{"Column1"})
in
    #"Replaced Value"

 

 

amitchandak_0-1685005142949.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.