Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello Everyone,
Im currentky struggleling with Power BI, here is the situation, i have a table with 1 column containing multiple path with "/" as separator.
e.i :
| Context |
| A/B/C |
| A1/A2/A3/A4 |
I need to transform it like that with 2 colums 'Name' and 'Context' :
| Name | Context |
| A | |
| B | A |
| C | A/B |
| A1 | |
| A2 | A1 |
| A3 | A1/A2 |
| A4 | A1/A2/A3 |
Did someone can helping me with that ? in power query or DAX it's the same for me...
Thanks in advance !
Julien
Solved! Go to Solution.
Hi , @Ju7438
For your need , i can be realized in Power Query Editor.
You can put this M code in "Advanced Editor" to refer to :
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WctR30ndWitUBsgz1HY30HY31HU2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Context = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Context", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", (x)=>Text.Split(x[Context],"/") ),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom2", (x)=>
Table.AddColumn(Table.FromColumns({{0..List.Count(x[Custom])-1}}),"test",(y)=> Text.Combine(List.Range(x[Custom],0,y[Column1]),"/") )[test]
),
Custom1 = Table.FromColumns({List.Combine(#"Added Custom1"[Custom]) , List.Combine(#"Added Custom1"[Custom2])})
in
Custom1
Then we can meet your need:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
Sorry for the late response, it's working weel for me your solution fit perfectly with my neededs !
Thanks a lot !
BR
Julien
Hi , @Ju7438
For your need , i can be realized in Power Query Editor.
You can put this M code in "Advanced Editor" to refer to :
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WctR30ndWitUBsgz1HY30HY31HU2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Context = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Context", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", (x)=>Text.Split(x[Context],"/") ),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom2", (x)=>
Table.AddColumn(Table.FromColumns({{0..List.Count(x[Custom])-1}}),"test",(y)=> Text.Combine(List.Range(x[Custom],0,y[Column1]),"/") )[test]
),
Custom1 = Table.FromColumns({List.Combine(#"Added Custom1"[Custom]) , List.Combine(#"Added Custom1"[Custom2])})
in
Custom1
Then we can meet your need:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!