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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pl8564
New Member

Distinct Count not working in DIRECT QUERY

Hello Everyone,

I see an issue with distinct count in direct query reports.

I wanted to get distinct count of ACRDID in the below image.

 

The total distinct are just 21 but it is showing the total number of ACRDID(2423454). It is not grouping with the other columns.

 

If I just keep the ID it only gives the 21 values but if I change it to count to gives me the wrong number. 

 

 

 

 

 

1 ACCEPTED SOLUTION

Hi @pl8564 ,

 

Please check the limitation of distinct count function in offical blog.

For reference: Remarks

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

If you use distinct count function in a measure, I think it will work.

Here is my test. Distinct count works in my measure.

1.png

Or you can try distinct count in value field.

2.png

Best Regards,
Rico Zhou

 

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

View solution in original post

4 REPLIES 4
pl8564
New Member

Yes thats not working. Its giving me the total count of acrdid rather than acrdid associated with the account

Hi @pl8564 ,

 

Please check the limitation of distinct count function in offical blog.

For reference: Remarks

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

If you use distinct count function in a measure, I think it will work.

Here is my test. Distinct count works in my measure.

1.png

Or you can try distinct count in value field.

2.png

Best Regards,
Rico Zhou

 

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

Measure works but doesnt give me the right now. Its not grouping by its adding up all the acrdids

 

for a paticular customer I only have 8 acrdids and total if I remove is 2419547

 

Instead of showing 8 its shows 2419547

amitchandak
Super User
Super User

@pl8564 , Are you using

distinctcount(Table[ACRDID])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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