Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello everyone!
I would like to ask help with solving my task.
I have 1 column in power bi which contains string values.
Here the example
In other words,
I need to start from down and minus previous row.
For example,
row 1 = "Marek"
row 2 = "Marek, Marek, Jakub". The result will be "Marek, Marek, Jakub" - "Marek" = "Marek, Jakub"
row 4 = "Jakub, Marek, Jakub". The result will be "Jakub, Marek, Jakub" - "Marek, Jakub" (what we get as a result in row 1) = "Jakub"
Thank you in advance for any suggestiona and advices,
Ekaterina
Your row number sequence is off for 13 and 15. Please clarify.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfJNLErNVorViVYygvF0FKCUV2J2aRJYzgQoB+ZhkTOHyYF5hgZAbkBiWX4OhGuMyjUFcoPz8xIhNhpAeToKEDIgtSS1CCIFchuYi0XOGCEHpYCOKsnMU4qNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Row = _t, Input = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Row", Int64.Type}, {"Input", type text}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Result", each List.Accumulate({0..[Index]},"",(state,current)=>
let p = Text.PositionOf(#"Added Index"[Input]{current},state)
in if p=-1 then #"Added Index"[Input]{current} else Text.RemoveRange(#"Added Index"[Input]{current},p,Text.Length(state))),type text),
#"Replaced Value" = Table.ReplaceValue(#"Added Custom",each [Result],each if Text.StartsWith([Result],", ") then Text.RemoveRange([Result],0,2) else [Result],Replacer.ReplaceValue,{"Result"})
in
#"Replaced Value"
How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the Source step with your own source.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 49 | |
| 35 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 91 | |
| 75 | |
| 41 | |
| 26 | |
| 25 |