Forum Discussion
AllanBerces
6 months agoPost 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. DESIRED OUTPUT ...
- 6 months ago
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] ) - 6 months ago
Result = IF( CALCULATE( ISEMPTY( DATA ), ALLEXCEPT( DATA, DATA[Job] ), DATA[Progress] < 0 ), DATA[Progress], 0 ) - 6 months ago
Please try the formula below:
Result = VAR JobTotalProgress = CALCULATE ( SUM ( 'Table'[Progress] ), ALLEXCEPT ( 'Table', 'Table'[Job] ) ) RETURN IF ( JobTotalProgress < 0, 0, 'Table'[Progress] ) - 6 months ago
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 ) - 6 months ago
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.
danextian
6 months agoSuper 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
)
- AllanBerces6 months agoPost Prodigy
Hi danextian cengizhanarslan ThxAlot rohit1991 thank you very much for the reply working perfectly.