Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Count unique/distinct values from two different tables

I have two columns in two different tables. 1) Accounts[Account Name] 2) Visits[Regarding Account]   I want to count how many unique/distinct values from Visits[Regarding Account] are on Accounts...
  • v-kelly-msft's avatar
    v-kelly-msft
    5 years ago

    Hi  Anonymous ,

     

    Using below dax expression:

     

    Measure = CALCULATE(DISTINCTCOUNT(Visits[Regarding Account]),ALL(Visits))-CALCULATE(DISTINCTCOUNT(Visits[Regarding Account]),FILTER(ALL(Visits),Visits[Regarding Account] in FILTERS(Accounts[Account Name])))

     

    And you will see:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!