Forum Discussion

snoozee's avatar
snoozee
Regular Visitor
2 years ago
Solved

Weekly Check Calculation

Hi   I have a table that contains the following columns   Location, Date, CheckNotCompleted. WeekNumber and Year   My CheckNotCompleted column contains a Yes or No response   I need DAX to cr...
  • v-weiyan1-msft's avatar
    v-weiyan1-msft
    2 years ago

    Hi snoozee ,

     

    Based on the screenshot you provided, you need to change the code slightly as follows.

    Weekly Check = 
    VAR CurrentLocation = 'Table'[Location]
    VAR Cnt =
        CALCULATE (
            COUNT ( 'Table'[CheckNotCompleted] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[WeekNumber] ),
                'Table'[CheckNotCompleted] = "Yes"
                    && 'Table'[Location] = CurrentLocation
            )
        )
    RETURN
        IF ( Cnt >= 1, "Y", "N" )

    Result is as below.

    Hope that works for you.
    For further details,please find attachment.


    Best Regards,
    Yulia Yan


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.