Forum Discussion

coollehavre's avatar
coollehavre
Frequent Visitor
8 years ago
Solved

count distinct by month

Hi, i have a table like this :    Id       Date           Count 1069  1/12/2018   1 1069  1/20/2018   0 ... 1069  2/02/2018   1   TOTAL                   2   I would like to count each ID b...
  • Zubair_Muhammad's avatar
    8 years ago

    coollehavre

     

    Please try this MEASURE

     

    Measure =
    IF (
        HASONEFILTER ( Table1[Date].[Month] ),
        CALCULATE ( DISTINCTCOUNT ( Table1[Id] ) ),
        SUMX (
            ALLSELECTED ( Table1[Date].[Month] ),
            CALCULATE ( DISTINCTCOUNT ( Table1[Id] ) )
        )
    )