Forum Discussion

slobodan's avatar
slobodan
New Member
4 years ago

Count unique names

Hello,

 

I think I have a trouble understanding how COUNTDISTINCT works. When I use this formula in measure to get unique values of names from one column, this formula takes into account not only data from this column but from others as well. 

 

So, for example, instead to get 30 unique names, I get around 50. I know I get 50 because these names are related to data in different columns. But I want Power BI to see only this one column when executing calculation. 

 

Simple explained: I want to get the number (count) of unique names that appear in one specific column (Full name). 

 

Thanks. 

3 Replies

  • slobodan , if you distinctcount , then total or the card you have has value of unique names

     

    but if you group it by say city, then city will show distinct name in city and but grand total will be distinct name overall

  • aj1973's avatar
    aj1973
    Community Champion

    Hi slobodan 

    Add a new column where you CONCATENATE column NAMES to column SURNAMES and you will have a FULL NAME column. Then use DISTINCTCOUNT on the new column FULL NAME.

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi slobodan ,

     

    Calculated measure is not treated the same as any other table column. Unlike a calculated column, measures are evaluated on the fly with every change in context.

    We don't know your scenario and the expected results. It's difficult to give an accurate answer just by imagination.

    https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 


    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.