Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
dodiyal
Frequent Visitor

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

2 ACCEPTED SOLUTIONS

Hi,

Thank you for your feedback, and please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1662118422942.png

 


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

dodiyal
Frequent Visitor

5 REPLIES 5
dodiyal
Frequent Visitor

hi

dodiyal
Frequent 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 SPDweekin numberssale
36-2220223625
37-2220223717
38-2220223822
39-222022398
40-2220224016
41-222022413
42-222022425
43-2220224310
44-222022442
45-222022452
46-222022463
47-222022473
48-222022482
49-222022496
50-222022502
51-222022516
52-222022523
53-222022531
01-232023012
02-232023021
03-232023032
05-232023055
06-232023062
07-232023074
08-232023085
12-232023124
13-232023131
14-232023141
15-232023151
17-232023171
22-232023221

Hi,

Thank you for your feedback, and please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1662118422942.png

 


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

you are awesome, thanks a lot

Jihwan_Kim
Super User
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.

 

Jihwan_Kim_0-1662114952350.png

 

Expected measure: = 
CALCULATE ( [Sales total:], REMOVEFILTERS () )
    - CALCULATE ( [Sales total:], Data[Week] <= MAX ( Data[Week] ) )

 


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors