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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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

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

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.