Excel BI Power Query Challenge Workout 066

-CAN YOU SOLVE THIS - POWER QUERY CHALLENGE 66-
(Solution in any language also welcome for Power Query Challenges)

Perform total like this for every product.
Only possible categories are A and B.
For A, total column will be 0.
For B, it will be deducted from running total of A.
For row 3, 160-110 = 50
For row 6, 50 (remaining from above step)+180+40-90=180
For row 7, 180(remaining from above step)-50=310
Also if start of the group is not with A, it means no B needs to be deducted.
Hence for those B, total will be 0.
For example for Product 3, row 15, 16 & 17 don’t have A prior.
Hence, total will be 0 for these rows.
Total can’t be negative. In case of negative, make the total 0.

Download Practice File - https://lnkd.in/dECbJke5

(Post answers in Comment. Your approach need not be different from others as long as you have worked out your approach independently)

#powerquerychallenge, #daxchallenge, #m, #dax, #powerbi, #powerquery, #powerpivot, #sheets, #googlesheets, #data, #analytics, #businessintelligence, #finance, #excel, #excelchallenge, #python, #r

Excel BI’s LinkedIn Post