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
RochesterMD
New Member

Distinct Count is one number off?

Hello everyone. I"m having an issue where I have two columns to compare. One is a count of entries in a (let's say column A) for which I'm using Count(A). The other column is a distinct(count) on date/time. The date/time field looks something like 11/20/2022 09:20:21:42. So all the way to basically a millisecond. Let's call this column B. 

I have created a table where it lists numbers across different users assocated with each row. The users are columns as there are less users than there are ways to gather the numbers. The way I set up the counts should return the exact same numbers in this specific scenario. Looking at the tables column A and Column B for each user are identical, but the totals in the matrix are not. The only place I see a difference is in the total. The other columns (side by side across all users have the same numbers). 

I just don't understand how both functions could return the same numbers to be added up but column B is one less than I calculate moving across the matrix. Any help on understanding how this might happen is greatly appreciated. 

RochesterMD_0-1670466769128.png

The last A and B columns to the right are of course the totals. the image is a little distorted, but in the matrix Column A is next to Column B and the numbers being counted are the same in each column pair all the way up to Totals, where they are oddly different. 






3 REPLIES 3
ppm1
Solution Sage
Solution Sage

Do the numbers match if you use the DISTINCTCOUNTNOBLANK() function instead? If you have values that exist on the many side but not on the 1 side of the relationship, a blank row is created.

 

Pat

 

Microsoft Employee

DISTINCTCOUNTNOBLANK() returns a number different than both of the other methods. lol. Distinctcountnoblank is about 5 less than Column B on the same day. It's also returning different results than either of the other two columns for the other days whereas the numbers of A and B are the same. The count from the source data matches the amount in column A. 

I thought CountA would skip counting blanks? Also, I'll add the these columns should only be the same under the current filter conditions. For example Column B is calculated using distinct time of submission. So, there are up to 21 rows per submission where 21 entries in a specific column could be blank (due to unpivoting 21 columns). By counting the time, I'm also counting entries where the the said column should be blank for up to 21 blanks. There are instances where all 21 of said unpivoted columns (hence 21 blanks are in place of 1) would be accurate, but there is other data that is needed from the rows in that situation. 

For Column A, the count is straight forward. I just need to count the entries that are not blank hence the use of countA (As it appeared it would skip counting blanks). 

With 2 specific filters, the scenario should always return the same result with both of my calculations, or so I thought. If you total all of the As and compare to the Bs, they add up to the same number, but the total for column B that is auto calculated does not. 

RochesterMD
New Member

I'll add that there is one day (the day it appears to be thrown off) where there are two separate entries just 1 millisecond apart. However, the count still matches in all the columns except the column B total.

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