Forum Discussion

AllanBerces's avatar
AllanBerces
Post Prodigy
1 year ago
Solved

0 if Not started

Hi good day can anyone help me on my table, what i required is that if the Plan Hrs column not yet started the earned column should be 0.  My Earned column code:   Earned = CALCULATE (     SUM ...
  • Anonymous's avatar
    Anonymous
    1 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.