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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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.


Go to 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.


Go to 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.


Go to My LinkedIn Page


Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.