Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
SaihanSadique
Regular Visitor

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 about using functions such as DISTINCTCOUNT and similiar functions, 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.

Here is an example query which I'm trying to use.

Active Headcount =
DISTINCTCOUNT('Employee Details'[Employee ID])
1 ACCEPTED SOLUTION
danextian
Super User
Super User

hi @SaihanSadique 

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

danextian_0-1750677118444.png

 

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. 

danextian_1-1750677537477.png

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

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

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @SaihanSadique,


I just wanted to follow up on your thread. If the issue is resolved, it would be great if you could mark the solution so other community members facing similar issues can benefit too.
If not, don’t hesitate to reach out, we’re happy to keep working with you on this.

 

Regards,

Vinay Pabbu

Hi @SaihanSadique,

Hope you had a chance to try out the solution shared earlier. Let us know if anything needs further clarification or if there's an update from your side always here to help.

Thank you.

Hi @SaihanSadique,

Just wanted to follow up one last time. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.

Thank you.

danextian
Super User
Super User

hi @SaihanSadique 

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

danextian_0-1750677118444.png

 

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. 

danextian_1-1750677537477.png

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

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

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
pankajnamekar25
Super User
Super User

Hello @SaihanSadique 

 

try this DAX

ActiveHeadcountFlag = SUMX(

    VALUES('Employee Details'[Employee ID]),

    1

)

Thanks

 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors