Forum Discussion
0 if Not started
- Anonymous1 year ago
Hi AllanBerces ,
You're right, using Plan Hrs = 0 to decide if a task has started doesn't always work, especially if work begins early without planned hours.
So instead of checking Plan Hrs, we should only return 0 in the Earned column if no actual work has been recorded yet.
Here’s an updated measure that does just that:
Earned = VAR EarnedCalc = CALCULATE ( SUM ( 'Table'[Earned] ), FILTER ( ALL ( 'Table' ), 'Table'[Progress Date] = EARLIER ( 'Tabl02'[PlanDate] ) && 'Table'[Location] = EARLIER ( 'Tabl02'[TaskNo] ) && 'Table'[Mode] = EARLIER ( 'Tabl02'[A -Mode] ) ) ) RETURN IF ( ISBLANK(EarnedCalc), 0, EarnedCalc )This will show 0 only if no Earned hours are found. If any work is done, it will show the actual value.
If the issue still persists after doing the above things, please provide sample data as mentioned by Ashish_Excel .
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
Hi AllanBerces ,
Thank you for your feedback, and I appreciate you trying out the suggested solution.
Based on your clarification, it seems the core condition for showing Earned = 0 is tied directly to the Plan Hrs column specifically when the value is zero (indicating the task has not started). The previous logic based on date may not fully address this.
Please try the following revised DAX measure which includes a check on Plan Hrs:
Earned =
IF (
'Tabl02'[Plan Hrs] = 0,
0,
CALCULATE (
SUM ( 'Table'[Earned] ),
FILTER (
ALL ( 'Table' ),
'Table'[Progress Date] = EARLIER ( 'Tabl02'[PlanDate] )
&& 'Table'[Location] = EARLIER ( 'Tabl02'[TaskNo] )
&& 'Table'[Mode] = EARLIER ( 'Tabl02'[A -Mode] )
)
)
)
With this update:
- If Plan Hrs = 0, the Earned column will return 0.
- Otherwise, it will compute the earned value as per your existing logic.
Please let me know if this now aligns with your expectations or if further adjustments are needed.
If this helps, kindly consider marking this as a solution for future reference to others as well.
Thank you!
Hi AllanBerces ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
- AllanBerces1 year agoPost Prodigy
Hi Anonymous thank you for the reply, but unfortunately there are times my plan is 0 but they execute the job early that need to reflect on my earned hrs.
- Anonymous1 year agoNot applicable
Hi AllanBerces ,
You're right, using Plan Hrs = 0 to decide if a task has started doesn't always work, especially if work begins early without planned hours.
So instead of checking Plan Hrs, we should only return 0 in the Earned column if no actual work has been recorded yet.
Here’s an updated measure that does just that:
Earned = VAR EarnedCalc = CALCULATE ( SUM ( 'Table'[Earned] ), FILTER ( ALL ( 'Table' ), 'Table'[Progress Date] = EARLIER ( 'Tabl02'[PlanDate] ) && 'Table'[Location] = EARLIER ( 'Tabl02'[TaskNo] ) && 'Table'[Mode] = EARLIER ( 'Tabl02'[A -Mode] ) ) ) RETURN IF ( ISBLANK(EarnedCalc), 0, EarnedCalc )This will show 0 only if no Earned hours are found. If any work is done, it will show the actual value.
If the issue still persists after doing the above things, please provide sample data as mentioned by Ashish_Excel .
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
- Anonymous1 year agoNot applicable
Hi @AllanBerces ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.