Forum Discussion

leibowjb's avatar
leibowjb
Frequent Visitor
8 years ago
Solved

Counting duplicat values

I have a dataset related to automotive service data. The dataset has 165K rows which is the total number of repair orders that came into the shop.   I need to calculate two measures: Unique: The ...
  • v-sihou-msft's avatar
    8 years ago

    leibowjb

     

    In this scenario, you can create a variable to get th count of visits for each user. 

     

    =CALCULATE(COUNTA(Table[VisitDate]),ALLEXCEPT(Table,Table[User]))

    Then you can create a measure to filter users with more than 2 visits. 

     

     

    2 plus visits users =
    VAR CountOfVisits =
        CALCULATE ( COUNTA ( Table[VisitDate] ), ALLEXCEPT ( Table, Table[User] ) )
    RETURN
        CALCULATE (
            DISTINCTCOUNT ( Table[User] ),
            FILTER ( Table, CountOfVisits >= 2 )
        )

    Regards,

  • pnvinod's avatar
    pnvinod
    8 years ago

    In the CALCULATE  you can add another FILTER => ALLSELECTED([Dates]