Forum Discussion

SethuPower's avatar
SethuPower
Frequent Visitor
6 years ago
Solved

Count Status as per the Date Filter

Hello All,   My input data looks like below. I have a slicer with Date Range. Depending on the Date filter, my output to change    Eg. If the date range is less than or Equal to 25-Jun-18, Then i...
  • v-juanli-msft's avatar
    v-juanli-msft
    6 years ago

    Hi SethuPower 

    In addition to my previous reply,

    Create measures

    distincount status per day =
    CALCULATE (
        DISTINCTCOUNT ( Table1[Status] ),
        FILTER (
            ALLSELECTED ( Table1 ),
            Table1[ID] = MAX ( Table1[ID] )
                && Table1[StatusDate] = MAX ( Table1[StatusDate] )
        )
    )
    

    Modify measure

    open =
    VAR countopen =
        COUNTX (
            FILTER (
                ALLSELECTED ( Table1 ),
                Table1[ID] <> MAX ( Table1[ID] )
                    && [open/closed] = "Open"
            ),
            [open/closed]
        )
    RETURN
        IF ( [distincount status per day] > 1, countopen - 1, countopen )
    

    Best Regards
    Maggie
     
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.