Forum Discussion
Subtracting values in same column until the value becomes 0
Hello Team,
I have a data set where i have to subtract value untill its zero can you please help me. I need dax to solve-
Please see the data
week sale
Week1 10
week2 5
week3 5
Total 20
So here the toal sale is 20 and i need the resuls like this
Week Sale
Week1 10 (20-10)
Week2 5 (10-5)
Week3 0 (5-0)
Appreciate your help please
Hi,
Thank you for your feedback, and please check the below picture and the attached pbix file.
5 Replies
- Jihwan_Kim
Super User
Hi,
I am not sure if I understood correctly your question, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file whether it suits your requirement.
I hope the below can provide some ideas on how to create a solution for your dataset.
Expected measure: = CALCULATE ( [Sales total:], REMOVEFILTERS () ) - CALCULATE ( [Sales total:], Data[Week] <= MAX ( Data[Week] ) ) - dodiyalFrequent Visitor
hi jihwan,
thank you for quick reply. i checked but still it is showing high values instead of burn down till zero, pleaserefer the data i worked on, can you please look into thisd and advise.
Appreciate your help.
WEEK REVISED SPD weekin numbers sale 36-22 202236 25 37-22 202237 17 38-22 202238 22 39-22 202239 8 40-22 202240 16 41-22 202241 3 42-22 202242 5 43-22 202243 10 44-22 202244 2 45-22 202245 2 46-22 202246 3 47-22 202247 3 48-22 202248 2 49-22 202249 6 50-22 202250 2 51-22 202251 6 52-22 202252 3 53-22 202253 1 01-23 202301 2 02-23 202302 1 03-23 202303 2 05-23 202305 5 06-23 202306 2 07-23 202307 4 08-23 202308 5 12-23 202312 4 13-23 202313 1 14-23 202314 1 15-23 202315 1 17-23 202317 1 22-23 202322 1 - Jihwan_Kim
Super User
Hi,
Thank you for your feedback, and please check the below picture and the attached pbix file.
- dodiyalFrequent Visitor
you are awesome, thanks a lot
- dodiyalFrequent Visitor
hi