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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
nickappftna
New Member

Incorrect DISTINCTCOUNT value when counting unique dates in table

I've got a table showing a list of orderlines with SKUs, ordernumber, etc. I'm trying to eventually get to a measure showing the average number of orders per day, however my number of day calculation is being thrown off. 

 

To calculate the number of days, I'm creating a measure based off my "DATE" column (which shows DateTime):

Day Count = DISTINCTCOUNT(ORDERS[ORDERDATE].[DATE])

 I know I've got just over 1 year's worth of data, and in actuality, the true distinct count of dates should be 385, however this measure returns 730. At first I had thought that the timestamp was throwing this off, but If I'm understanding correctly, putting in ".[DATE]" should be counting just the date portion, not the times.

 

Any ideas? Thanks much in advance.

1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi @nickappftna ,

 

Create a column datevalue(datecolumn)

Then do a distinct count on that column, it should work.

 

Did I help you today? Please accept my solution and hit the Kudos button.

View solution in original post

3 REPLIES 3
davehus
Memorable Member
Memorable Member

Hi @nickappftna ,

 

Create a column datevalue(datecolumn)

Then do a distinct count on that column, it should work.

 

Did I help you today? Please accept my solution and hit the Kudos button.

Interesting. This does work -- thank you for the quick answer. Though I'm not sure I understand why my original (failed) solution does not work. Isn't the point of adding ".[DATE]" to specify that I only want to look at the date portion of the TimeStamp? ...as opposed to .[Day], .[Month], etc.?

It's actually not something I've used before and oddly enough there isn't much documentation on it on the MT website. I'll have to go digging into the dax guide to see.

 

If this has worked for you, please accept it as a solution 🙂 Thank you.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors