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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
AllanBerces
Post Prodigy
Post Prodigy

If Negative Sum 0

Hi good day, can anyone help me on my calculated column, from my table we required if the sum of total progress per Job is negative then the result is 0 if not then Progress.

AllanBerces_0-1769419825967.png

DESIRED OUTPUT

AllanBerces_1-1769419857889.png

JobTradeYearProgressWeek No.Result
KI222221Mech20269.1939.19
KI222221Mech20261.8141.81
KI222221Mech202615.68215.68
KI222221Mech202614.6114.6
WERT0123E&I20264.3414.34
WERT0123E&I20265.5225.52
WERT0123E&I20263.433.4
WERT0123E&I202669.27469.27
QWERT65Civil202630.97130.97
QWERT65Civil20266.5126.51
QWERT65Civil202614.56314.56
QWERT65Civil202617.7417.7
BFGT435Mech20269.4440
BFGT435Mech2026-30.0620
TYJJ56984Plumber20260.0210
TYJJ56984Plumber2026-9.4720
TYJJ56984Plumber2026-0.0230
TYJJ56984Plumber20264.4840
HOYTJ0978Civil2026-4.0620
HOYTJ0978Civil202619.7340
HOYTJ0978Civil2026-39.9930
5 ACCEPTED SOLUTIONS
rohit1991
Super User
Super User

Hii @AllanBerces 

 

If the total Progress per Job (and Year) is negative, return 0, otherwise return the original Progress value.

Result = 
VAR TotalJobProgress =
    CALCULATE (
        SUM ( 'ProgressData'[Progress] ),
        ALLEXCEPT ( 'ProgressData', 'ProgressData'[Job], 'ProgressData'[Year] )
    )
RETURN
IF ( TotalJobProgress < 0, 0, 'ProgressData'[Progress] )

 

image.png

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

ThxAlot
Super User
Super User

Result = 
IF(
    CALCULATE(
        ISEMPTY( DATA ), ALLEXCEPT( DATA, DATA[Job] ), DATA[Progress] < 0
    ),
    DATA[Progress],
    0
)

ThxAlot_0-1769422248997.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

cengizhanarslan
Super User
Super User

Please try the formula below:

Result =
VAR JobTotalProgress =
    CALCULATE (
        SUM ( 'Table'[Progress] ),
        ALLEXCEPT ( 'Table', 'Table'[Job] )
    )
RETURN
IF (
    JobTotalProgress < 0,
    0,
    'Table'[Progress]
)
_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

View solution in original post

danextian
Super User
Super User

Hi @AllanBerces 

 

You can use MAX to make sure that it returns either the positive result or zero at the minimum.

Progress Per Job =
MAX (
    CALCULATE ( SUM ( 'Table'[Progress] ), ALLEXCEPT ( 'Table', 'Table'[Job] ) ),
    0
)

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=if(CALCULATE(SUM(Data[Progress]),FILTER(Data,Data[Job]=EARLIER(Data[Job])))<0,0,Data[Progress])

Hope this helps.

Ashish_Mathur_0-1769470283481.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=if(CALCULATE(SUM(Data[Progress]),FILTER(Data,Data[Job]=EARLIER(Data[Job])))<0,0,Data[Progress])

Hope this helps.

Ashish_Mathur_0-1769470283481.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
danextian
Super User
Super User

Hi @AllanBerces 

 

You can use MAX to make sure that it returns either the positive result or zero at the minimum.

Progress Per Job =
MAX (
    CALCULATE ( SUM ( 'Table'[Progress] ), ALLEXCEPT ( 'Table', 'Table'[Job] ) ),
    0
)

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian @cengizhanarslan @ThxAlot @rohit1991 thank you very much for the reply working perfectly.

cengizhanarslan
Super User
Super User

Please try the formula below:

Result =
VAR JobTotalProgress =
    CALCULATE (
        SUM ( 'Table'[Progress] ),
        ALLEXCEPT ( 'Table', 'Table'[Job] )
    )
RETURN
IF (
    JobTotalProgress < 0,
    0,
    'Table'[Progress]
)
_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
ThxAlot
Super User
Super User

Result = 
IF(
    CALCULATE(
        ISEMPTY( DATA ), ALLEXCEPT( DATA, DATA[Job] ), DATA[Progress] < 0
    ),
    DATA[Progress],
    0
)

ThxAlot_0-1769422248997.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



rohit1991
Super User
Super User

Hii @AllanBerces 

 

If the total Progress per Job (and Year) is negative, return 0, otherwise return the original Progress value.

Result = 
VAR TotalJobProgress =
    CALCULATE (
        SUM ( 'ProgressData'[Progress] ),
        ALLEXCEPT ( 'ProgressData', 'ProgressData'[Job], 'ProgressData'[Year] )
    )
RETURN
IF ( TotalJobProgress < 0, 0, 'ProgressData'[Progress] )

 

image.png

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.