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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
aktripathi2506
Helper IV
Helper IV

Subtracting a cell value from a another cell (measure) in a single column

HI,

 

I have the following scenario:

In the visual I am summarising the weekly data.

So I have week then next column I have is hours, which is basically the sum of hours for the week.

I have a measure which has certain value.

Now I want the third column having ongoing subtraction:

 

If the value of measure is 3200 then value of column 'new' should be as follows:

 

WeekHoursNew
1253175
2483127
33862741
43742367
56881679
63521327
7534793
8365428
9164264
10295-31

 

Thanks & Regards,

A

2 ACCEPTED SOLUTIONS
jahida
Impactful Individual
Impactful Individual

New version of the formula:

 

Measure = 500 - MINX(test, SUMX(FILTER(ALL(test), test[Week] <= EARLIER(test[Week]) && test[Week] > 0 && test[Report Week] = EARLIER(test[Report Week])), test[Hours]))

View solution in original post

After seeing his data; the key is that have weeks with negatives values, so the measure was modified to:

 

MeasureToSubstractions = [Measure]-CALCULATE(Sum(test[Hours]);FILTER(ALLEXCEPT(test;Test[Year];test[Report Week]);test2[Week]<=max(test[Week]) && test[Week]>0))




Lima - Peru

View solution in original post

25 REPLIES 25

Can you share us the pbix file; deleting all the data that you considered critical to show. I think this will be the  easy way to help you in more reduced time.

 

 




Lima - Peru

After seeing his data; the key is that have weeks with negatives values, so the measure was modified to:

 

MeasureToSubstractions = [Measure]-CALCULATE(Sum(test[Hours]);FILTER(ALLEXCEPT(test;Test[Year];test[Report Week]);test2[Week]<=max(test[Week]) && test[Week]>0))




Lima - Peru

Thank you so much guys. Both of you @Vvelarde and @jahida for your sincere efforts and time.

Thanks a lot. It worked now, finally :))

 

MeasureValues = [Measure]-CALCULATE(Sum(WeekReport[hours]);FILTER(ALLEXCEPT(WeekReport;WeekReport[Reporting Week]);WeekReport[week]<=max(WeekReport[week])))



Lima - Peru

Hi @aktripathi2506

 

Values = [Measure]-CALCULATE(Sum(WeekReport[hours]);FILTER(ALLEXCEPT(WeekReport;WeekReport[Reporting Week]);WeekReport[week]<=max(WeekReport[week])))



Lima - Peru

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.