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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
PoojaTekriwal
Regular Visitor

Split a column based on where condition from another column

  1. want to split a column contaning this value
  2. asset-symbol column name
C 21/03/19 C 72.000

 

into 4 new column where my assetype(another column containing values equity,option)=equity

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Please try to add 2 new columns:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclYwMtQ3MNY3tFRwVjA30jMwUNJRctXxV4rViVZy93WFShuYAqWNzE1R5b1dQRwwMyTYxxFhVICCqYGBAapiR9+gYIjyWAA=", 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}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.BeforeDelimiter([Column1], " ")),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Text.BetweenDelimiters([Column1], " ", ".", 2, 1))
in
    #"Added Custom1"

V-lianl-msft_0-1616746780532.png

 

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Please try to add 2 new columns:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclYwMtQ3MNY3tFRwVjA30jMwUNJRctXxV4rViVZy93WFShuYAqWNzE1R5b1dQRwwMyTYxxFhVICCqYGBAapiR9+gYIjyWAA=", 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}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.BeforeDelimiter([Column1], " ")),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Text.BetweenDelimiters([Column1], " ", ".", 2, 1))
in
    #"Added Custom1"

V-lianl-msft_0-1616746780532.png

 

amitchandak
Super User
Super User

@PoojaTekriwal , In power query, ISe split option right click of column Based on Space in new 4 columns

refer my Video: https://www.youtube.com/watch?v=FyO9Vmhcfag

or

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

My requirement is that i want to split my first column when my fifth column value is option,equity otherwise no split

PoojaTekriwal_0-1616566632315.png

 

Anonymous
Not applicable

Hello @PoojaTekriwal ,

 

I am not sure its possible to split column with condition. But you can filter the value on the column and then split the column. But that will skipped the other data. I am not sure whether you will get the desired result you want.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.