Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 31 | |
| 22 | |
| 14 |
| User | Count |
|---|---|
| 67 | |
| 58 | |
| 30 | |
| 27 | |
| 25 |