Forum Discussion

nvizard's avatar
nvizard
Regular Visitor
6 years ago
Solved

Count distinct values across two separate rows in two separate tables

Hi all,

I am trying to count the number of distinct values that occur in two separate columns in two separate tables (count the number of distinct values as though the two columns were appended) 

For example, if I had the two columns below :

1                       1

2                       3

3                       5

4                       7

5                       9

 

it should return a count of 7, 3 values were not counted (1,3,5) as they appeared twice.

 

Many thanks for your help

  • nvizard 

     

    You may try the measure below.

    Measure =
    COUNTROWS (
        DISTINCT ( UNION ( VALUES ( Table1[Column1] ), VALUES ( Table2[Column1] ) ) )
    )
    

     

3 Replies