Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
90 | |
84 | |
70 | |
49 |
User | Count |
---|---|
143 | |
121 | |
112 | |
58 | |
57 |