Forum Discussion

twowaysyellow's avatar
twowaysyellow
Frequent Visitor
3 years ago
Solved

Count unique/distinct values over multiple columns

How can I count distinct values over multiple columns?   This is probably a really simple thing, but I haven't been able to find an answer I am managing to apply. Probably due to my lack of skill. ...
  • Arul's avatar
    3 years ago

    twowaysyellow ,

    try this measure,

    Distinct count = 
    VAR _val1 = VALUES(Tablename[Value 1])
    VAR _val2 = VALUES(Tablename[Value 2])
    VAR _union = DISTINCT(UNION(_val1,_val2))
    RETURN COUNTROWS(_union)

    Thanks,

    Arul