March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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?
Solved! Go to 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:
Hey @Sohan ,
you can do a COUNTROWS of VALUES.
If you give some example data, I could give you a solution.
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:
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:
Thank you so much!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
93 | |
90 | |
86 | |
76 | |
49 |
User | Count |
---|---|
166 | |
149 | |
99 | |
73 | |
57 |