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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.