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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
fredrikahnell
Frequent Visitor

Split value to several rows

Hi, I am a bit new to Power BI and have tried to search for an solution to how I should split my values into several rows.

 

When get the data it looks like this

IDTags
1{A,B,C}

2

{A}

3{}

 

 

I would like it to be splitted like this

IDTags
1A

1

B

1

C

2

A

3

 

 

I don't really know where to start. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Please refer :

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

https://www.youtube.com/watch?v=0roS4OVfD9k

This is in edit query mode

 

You also have to use :https://docs.microsoft.com/en-us/powerquery-m/text-replace

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

View solution in original post

3 REPLIES 3
Mariusz
Community Champion
Community Champion

Hi @fredrikahnell 

 

Please see a solution below.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUap21HHSca5VitWJVjIC8yFsYxAbyIwFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, Tags = _t]),
    #"Added Custom" = Table.AddColumn(Source, "New Tags", each Text.Split( Text.Remove( [Tags], {"{","}"} ), "," ) ),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"ID", "New Tags"}),
    #"Expanded New Tags" = Table.ExpandListColumn(#"Removed Other Columns", "New Tags"),
    #"Changed Type" = Table.TransformColumnTypes(#"Expanded New Tags",{{"New Tags", type text}})
in
    #"Changed Type"

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

amitchandak
Super User
Super User

Please refer :

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

https://www.youtube.com/watch?v=0roS4OVfD9k

This is in edit query mode

 

You also have to use :https://docs.microsoft.com/en-us/powerquery-m/text-replace

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Wow, that was easy. Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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