Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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!
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
102 | |
99 | |
38 | |
37 |
User | Count |
---|---|
158 | |
125 | |
76 | |
74 | |
63 |