Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I have gone through some of the posts on this forum. Please have a look at my table.
I want to calculate the number of work days for the series of "Date", i.e. exclude Saturdays, Sundays, and "Holiday" (in Work column). There may not be a holiday in a particular Date Range.
Employee | Work | Hours | Date |
Person 1 | Task 1 | 4 | 09-Aug-21 |
Person 1 | No Work | 2 | 09-Aug-21 |
Person 1 | Task 2 | 2 | 09-Aug-21 |
Person 2 | Task1 | 3 | 09-Aug-21 |
Person 2 | Task 2 | 1 | 09-Aug-21 |
Person 2 | Leave | 4 | 09-Aug-21 |
Person 3 | No Work | 3 | 09-Aug-21 |
Person 3 | Task 2 | 5 | 09-Aug-21 |
Person 1 | Holiday | 8 | 10-Aug-21 |
Person 2 | Holiday | 8 | 10-Aug-21 |
Person 3 | Holiday | 8 | 10-Aug-21 |
Person 1 | Task 2 | 8 | 11-Aug-21 |
Person 2 | Task 3 | 8 | 11-Aug-21 |
Person 3 | Task 4 | 8 | 11-Aug-21 |
Person 1 | Task 2 | 8 | 12-Aug-21 |
Person 2 | Task 3 | 8 | 12-Aug-21 |
Person 3 | Task 2 | 8 | 12-Aug-21 |
Solved! Go to Solution.
Hi @TinyElephant ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
Create the below 2 measures to get the number of work days:
Number of work days =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Date] ),
FILTER (
'Table',
'Table'[Work] <> "Holiday"
&& WEEKDAY ( 'Table'[Date], 2 ) < 6
)
)
Measure = SUMX(VALUES('Table'[Employee]),[Number of work days])
Best Regards
@TinyElephant , between which range you wany workday?
Not very clear with example
The dates are mentioned in the Date column. In the image here you can see the date entries from 09 Aug 2021 to 12 Aug 2021. I don't want to manually mention the start and end date but to automatically pick it up from the Date column.
Later I would like to control the dashboard visuals using a Date Ranger slider.
Hi @TinyElephant ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
Create the below 2 measures to get the number of work days:
Number of work days =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Date] ),
FILTER (
'Table',
'Table'[Work] <> "Holiday"
&& WEEKDAY ( 'Table'[Date], 2 ) < 6
)
)
Measure = SUMX(VALUES('Table'[Employee]),[Number of work days])
Best Regards
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
133 | |
76 | |
53 | |
38 | |
37 |
User | Count |
---|---|
203 | |
81 | |
71 | |
55 | |
48 |