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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Sohan
Helper III
Helper III

DISTINCTCOUNT of values YTD

I'm trying to find the number of days an employee has worked. I'm doing this by looking at our appointments and seeing which days an employee has had an appointment. I'm trying to count the number of unique dates up until today.

 

Does anyone know how to achieve this?

1 ACCEPTED SOLUTION

Hey @Sohan ,

 

then you just have to filter the date to be smaller or equal than today:

Days Worked until today = 
CALCULATE(
    COUNTROWS(
        VALUES( 'sample'[Date appointment] )
    ),
    'sample'[Date appointment] <= TODAY()
)

 

The results changes accordingly:

selimovd_0-1624974688144.png

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

View solution in original post

6 REPLIES 6
selimovd
Super User
Super User

Hey @Sohan ,

 

you can do a COUNTROWS of VALUES.

If you give some example data, I could give you a solution.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Hi @selimovd, thanks for your reply. Here is some sample data. Let me know if you have questions about it.

Hey @Sohan ,

 

the following measure should do it:

Days Worked =
CALCULATE(
    COUNTROWS(
        VALUES( 'sample'[Date appointment] )
    )
)

 

The result could then look like that:

selimovd_0-1624968739198.png

 

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Hi @selimovd, thanks for your reply! I was able to achieve this, however I don't want future dates to be counted. I want the dates up until today to be counted.

Hey @Sohan ,

 

then you just have to filter the date to be smaller or equal than today:

Days Worked until today = 
CALCULATE(
    COUNTROWS(
        VALUES( 'sample'[Date appointment] )
    ),
    'sample'[Date appointment] <= TODAY()
)

 

The results changes accordingly:

selimovd_0-1624974688144.png

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

Thank you so much!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.