Forum Discussion

SaihanSadique's avatar
SaihanSadique
Regular Visitor
1 year ago
Solved

Is DISTINCTCOUNT function causing issues when trying to use Analyze feature?

Will a visual that uses DISTINCTCOUNT in its measure cause issues if you're trying to use the Analyze? I have checked the microsoft learn page for the Analyze function but it does not say anything a...
  • danextian's avatar
    1 year ago

    hi SaihanSadique 

    If you are refering to Analyze in Excel, DISTINCTCOUNT works fine. 

     

    Also could you please let me know if there are any other good resources for using dax measure visual which can make use of the insight function efficiently. This is unclear. What do you mean? You use DISTINCTCOUNT if you are trying to count the distinct values of a column. Bear in mind that if you use this in a table or matrix, it will be evaluated for each distinct value of the row or column category and at the total level for the whole of the table  so the sum of individual rows may not necessary be equal to the total. In the example below, there are only 4 distinct products at the total level: A, B, C and D. 

    The  following will return the same result as DISTINCTCOUNT assuming there are not blank products:

    COUNTROWS ( VALUES ( 'table'[product] ) )
    
    COUNTROWS ( DISTINCT ( 'table'[product] ) )