Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi power BI community
I want to make a report that see how much time diffrent people are available in diffrent month, to better plan capacity.
To achieve this I use three different tables.
Table one is a called User
it contains the columns [name], [user_id], [Monday], [Tuesday], [Wnedsday], [Thursday], [Friday]
[user_id] is a number that connects it to the other tables.
The last 5 columns monday - Friday contains the number of hours as a flow the user works that day.
I have a date table called Future
It contains all future days for the next three years
It has a column called [date] that contains the dates and a column that is called month_year that group the date together in the month and year the belong in like this "nov-26" for all dates in November 2026
the final table is called WorkPlanEntry
It contains a [date] that connects it to the future table
a [user_id] that connects it to the User table and a [Title] that shows why a user will not work a specific day. It could say "Holliday"
I also have a measure which calculate all the hours the users should work. it looks like this
Here is my problem. I want to exlude all the Hollidays and sick days from the WorkPlanEntry table.
Can anyone help me do this?
Alle help will be greatly appreciated.
Solved! Go to Solution.
To exclude holidays and sick days from the WorkPlanEntry table, you can modify your measure to filter out entries with Title values indicating holidays or sick days. Here's how you can adjust your Time measure:
Time =
VAR _filteredDates =
CALCULATETABLE(
'Future',
NOT(CONTAINSSTRING(RELATED(WorkPlanEntry[Title]), "Holiday") ||
CONTAINSSTRING(RELATED(WorkPlanEntry[Title]), "Sick"))
)
VAR _countMonday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 1) -- Monday
VAR _countTuesday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 2) -- Tuesday
VAR _countWednesday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 3) -- Wednesday
VAR _countThursday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 4) -- Thursday
VAR _countFriday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 5) -- Friday
VAR _totalMonday = SUM('User'[Monday]) * _countMonday
VAR _totalTuesday = SUM('User'[Tuesday]) * _countTuesday
VAR _totalWednesday = SUM('User'[Wendsday]) * _countWednesday
VAR _totalThursday = SUM('User'[Thursday]) * _countThursday
VAR _totalFriday = SUM('User'[Friday]) * _countFriday
RETURN
_totalMonday + _totalTuesday + _totalWednesday + _totalThursday + _totalFriday
To exclude holidays and sick days from the WorkPlanEntry table, you can modify your measure to filter out entries with Title values indicating holidays or sick days. Here's how you can adjust your Time measure:
Time =
VAR _filteredDates =
CALCULATETABLE(
'Future',
NOT(CONTAINSSTRING(RELATED(WorkPlanEntry[Title]), "Holiday") ||
CONTAINSSTRING(RELATED(WorkPlanEntry[Title]), "Sick"))
)
VAR _countMonday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 1) -- Monday
VAR _countTuesday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 2) -- Tuesday
VAR _countWednesday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 3) -- Wednesday
VAR _countThursday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 4) -- Thursday
VAR _countFriday = CALCULATE(COUNTROWS(_filteredDates), WEEKDAY(Future[Date], 2) = 5) -- Friday
VAR _totalMonday = SUM('User'[Monday]) * _countMonday
VAR _totalTuesday = SUM('User'[Tuesday]) * _countTuesday
VAR _totalWednesday = SUM('User'[Wendsday]) * _countWednesday
VAR _totalThursday = SUM('User'[Thursday]) * _countThursday
VAR _totalFriday = SUM('User'[Friday]) * _countFriday
RETURN
_totalMonday + _totalTuesday + _totalWednesday + _totalThursday + _totalFriday
Hi @rohit1991
Thanks for the answer. Your suggestion inspired me to use Related Tables and that solved my problem in the end. 🙂
Hi @ThomasWeppler ,
If this Holiday and Sick days data are not required for the entire report, then it is better that you filter these records in the Power Query.
In case if it is required and that you don't need it for this measure, then consider changing the DAX formula as follows.
Note: I am just making an assumption with this measure, not very sure this will work, but may be worth giving a try
Thanks for the suggestion.
I think it might be a good idea to focus on the DAX.
However when I put the DAX
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
75 | |
54 | |
37 | |
31 |
User | Count |
---|---|
99 | |
56 | |
50 | |
42 | |
40 |