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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. 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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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