Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
hi PowerBI experts,
i have a data file with the executed tasks of our employees and the date of these tasks. I want to calculate the number of unique days in a certain period in which tasks are executed.
I have the following data table:
| Task ID | Empl. ID | Date |
| 1 | 10 | 04-01-2021 |
| 2 | 10 | 04-01-2021 |
| 1 | 10 | 13-01-2021 |
| 3 | 10 | 15-01-2021 |
| 1 | 10 | 18-01-2021 |
| 5 | 20 | 11-01-2021 |
| 2 | 20 | 18-01-2021 |
| 7 | 20 | 18-01-2021 |
| 1 | 10 | 01-02-2021 |
| 5 | 10 | 08-02-2021 |
| 9 | 10 | 08-02-2021 |
| 9 | 20 | 08-02-2021 |
| 1 | 20 | 11-02-2021 |
| 1 | 20 | 12-02-2021 |
| 2 | 20 | 12-02-2021 |
I want the following outcome:
Company level:
| Month | Unique days tasks executed in selected period |
| Jan | 5 |
| Feb | 4 |
Employee level:
| Employee ID (jan and feb) | Unique days task executed in selected period (jan and feb) |
| 10 | 6 |
| 20 | 5 |
So if a employee performed multiple tasks on 1 day, it has to be calculated as 1 unique day (fe empl. ID 10 on 04-01-2021), and if 2 employees performed tasks on the same day, on general level it has to be calculated as 1 unique day, but on employee level it has to be calculated as 2 (fe 08-02-2021, where empl. ID 10 and 20 both performed tasks).
Many thanks for your help!
Regards,
Frank
Solved! Go to Solution.
Hi, @frankhofmans
To count only the working days, please create a calculated column as below
Column = IF(WEEKDAY('Data Table'[Date],2)IN{1,2,3,4,5}, 1, blank())
And then add a filter condition to your original measure as follows:
Unique days tasks executed in selected period =
CALCULATE (
DISTINCTCOUNT ( 'Data Table'[Date] ),
FILTER ( 'Data Table', 'Data Table'[Column] = 1 )
)
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi jdbuchanan71,
This works, but is there a way to count only the working days? I added a column (if date = weekday, 1, blank()) and did the distinctcount (on the new column), but i still get weekend results (strange, cause in the new colums, there aren't any weekend dates).
Thanks!
Hi, @frankhofmans
To count only the working days, please create a calculated column as below
Column = IF(WEEKDAY('Data Table'[Date],2)IN{1,2,3,4,5}, 1, blank())
And then add a filter condition to your original measure as follows:
Unique days tasks executed in selected period =
CALCULATE (
DISTINCTCOUNT ( 'Data Table'[Date] ),
FILTER ( 'Data Table', 'Data Table'[Column] = 1 )
)
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Give this a try.
Unique days tasks executed in selected period = DISTINCTCOUNT ( 'data table'[Date] )
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 40 | |
| 21 | |
| 18 |