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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

DAX DISTINCT and DISTINCTCOUNT does not ignore duplicates

Applying DISTINCT and DISTINCTCOUNT does not remove duplicates from Int64 column in Power BI Desktop.


The returned result is the same as the total count of records.


For example, this expression returns 2 for me:


Duplicates count after Distinct = COUNTROWS(FILTER(DISTINCT(LabelTracking[Order Item Id]), [Order Item Id] == 290363))
Table has 14134 recrods, some with duplicated Order Item Id (e.g. 290363). No matter if I try to use DISTINCT or DISTINCTCOUNT over the Order Item Id column, I get the same total count 14134.
No other filters used.
Status: New
Frequent Visitor

I have found a workaround:


Labeled Items Count = COUNTROWS(SUMMARIZE(LabelTracking, LabelTracking[Order Item Id], "Ones", 1))
gives me the expected distinct counf (measure "Ones" is required to make it working).
Frequent Visitor

Some extra info:

* the report is based on Push Power BI Service dataset

* importing of the report to Power BI Service does not fix the issue

* exporting of the data to csv file and doing the distinct count on top of the csv data works

Community Support



I tried the latest version to create a report and it seems to work fine for me.

Frequent Visitor

Hi @v-chuncz-msft ,

I guess this issue might be hard to reproduce. I can reproduce it only on one particular field on my side.

I do not know exactly how can I help you to reproduce it. I am using the APIs to create the dataset and to populate it with data. This setup is hard to replicate.


Do you maybe have some hints? Also, feel free to contact me directly.  I will be happy to help you to explore the issue.

Frequent Visitor

I have found a mistake in my data model. I guess, this is the reason.




The field is used in a relation and the wrong cardinality is specified for the fields. 


I guess, the distinccount somehow relies on this information.


Update: the change of the cardinality fixed the issue.