Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hello Everyone,
I am fairly new to Power Query, I want to acheive the following output, Appericiate if anyone can share a solution:
Thank you!
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26RihGlsokNEyk95dR_?e=zZQY8B
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
pls try this
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTJSitWJBpI6SiZgljGQZQpmmQBZZmAWkGGuFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Value 1" = _t, #"Value 2" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Value 1", Int64.Type}, {"Value 2", Int64.Type}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each List.Sum (List.Range(
#"Added Index"[Value 1],0,[Index]))+#"Added Index"[Value 2]{0})
in
#"Added Custom"
pls try this
List.Sum (List.Range(
#"Added Index"[Value 1],1,[Index])) +
#"Added Index"[Value 2]{0}
Thank you for this. It works fine, but it goes to infinite loop of the row & data keeps on loading forever. my hunch is there should be a break clause to end the sumation. Can you please share an update?
I don't know why it works like this for you.
maybe you have too many lines
Yes I do have more then 500,000 rows, I figured why it was going to loop. I am trying to use this caluse in else condition, instead of 224, it should be 9 + 0 Diagonally = 0, but it is showing 224?? Any ideas on this?
Hey @Ahmedx
Thank you for getting back. For some reasons its not working for me, I have attached an excel to use as raw data, if you can pleaseeeee use this in your PBI, I will be really greatful.
plse try this
if [Step] = 1 then [StepDuration] else [StepDuration] +
({null}&#"Added Index"[CummulativeDuration]){[Index]-1}
@Ahmedx Were you able to load this in PBI, it keeps on Loading, i think goes into a loop... Can you pleaseeeeee try loading it?
Hey, @Ahmedx Thank you for getting back. In the above link, you have just reference Previous Row & sum it up with Current context, the previous row should be dynamic based on current context. It works on the sheet that i shared earlier but not works where there the condition is in multiple else. I have updated the sheet at the following link, if you can please help me out, i am stuck from couple of day trying to figure this out. Column E is the required result.
Sheet is available at the following link:
https://1drv.ms/x/s!AgALyhOvtMpNgb50BM2kmBnEUs5D8g
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 5 | |
| 4 | |
| 4 |