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 Power BI Community,
I have a table of data as given below. Since the data is given per each week(Assuming week starts from Monday and week has only 5days) there are possibilities when a week starts in one month and ends in another month.
For example a week starting on 30Dec got 2 working days in December and 3 working days in jan 2025.
Now I need to show the Utilization by individual month and also by quartwise. How to handle this kind of situation.
The Utilization formula is given below the data.
Data Format example:
Region-- Dept--Week--BHours--NonBHours--ResourceCount
US -- HR -- 29Dec2024 -- 1314 -- 1622 -- 78
US -- Admin -- 29Dec2024 -- 925 -- 20 -- 60
US -- HR -- 06Jan2025 -- 126 -- 24 -- 3
US -- Admin -- 29Dec2024 -- 1023 -- 376 -- 30
UK -- HR -- 29Dec2024 -- 1600 -- 160 -- 88
UK -- Admin -- 29Dec2024 -- 1580 -- 21 -- 61
UK -- HR -- 06Jan2025 -- 1260 -- 24 -- 3
UK -- Admin -- 29Dec2024 -- 10231 -- 376 -- 30
Utilization = BHours / [ (40 * ResourceCount) - NonBHours]
Solved! Go to Solution.
Create a new table that expands each week into individual days.
DAX
DailyData =
ADDCOLUMNS (
GENERATE (
'WeeklyData',
CALENDAR (
'WeeklyData'[Week],
'WeeklyData'[Week] + 4
)
),
"Day", [Date],
"DailyBHours", 'WeeklyData'[BHours] / 5,
"DailyNonBHours", 'WeeklyData'[NonBHours] / 5
)
Create new calculated columns to extract the month and quarter from the date.
DAX
DailyData =
ADDCOLUMNS (
DailyData,
"Month", MONTH([Day]),
"Quarter", QUARTER([Day]),
"Year", YEAR([Day])
)
Now, you can create measures to calculate the utilization by month and quarter.
DAX
MonthlyUtilization =
CALCULATE (
DIVIDE (
SUM(DailyData[DailyBHours]),
SUMX (
DailyData,
(40 * DailyData[ResourceCount]) - DailyData[DailyNonBHours]
)
),
VALUES(DailyData[Month]),
VALUES(DailyData[Year])
)
DAX
QuarterlyUtilization =
CALCULATE (
DIVIDE (
SUM(DailyData[DailyBHours]),
SUMX (
DailyData,
(40 * DailyData[ResourceCount]) - DailyData[DailyNonBHours]
)
),
VALUES(DailyData[Quarter]),
VALUES(DailyData[Year])
)
Proud to be a Super User! |
|
Hi @Pradeep160
It is unclear whether you want then utilization formula to be evaluated for each date from the week +4 days or BHours, NonBHours and ResourceCount are to be divided by 5 but assuming that the formula is as straigforward as indicated, try this:
Utilization Time Period =
VAR StartDate =
MIN ( Dates[Date] )
VAR EndDate =
MAX ( Dates[Date] )
VAR _util =
SUMX (
VALUES ( Dates[Date] ),
SUMX (
ADDCOLUMNS (
FILTER ( 'Fact', 'Fact'[Week] <= EndDate && 'Fact'[Week] + 4 >= StartDate ),
"@Utilization",
DIVIDE ( 'Fact'[BHours], ( 40 * 'Fact'[ResourceCount] ) - 'Fact'[NonBHours] )
),
[@Utilization]
)
)
RETURN
_util
Another option, if the data isn't too big, is to materialize each date within the week + 4 in the query editor.
Please see attached sample pbix for details.
Proud to be a Super User!
Create a new table that expands each week into individual days.
DAX
DailyData =
ADDCOLUMNS (
GENERATE (
'WeeklyData',
CALENDAR (
'WeeklyData'[Week],
'WeeklyData'[Week] + 4
)
),
"Day", [Date],
"DailyBHours", 'WeeklyData'[BHours] / 5,
"DailyNonBHours", 'WeeklyData'[NonBHours] / 5
)
Create new calculated columns to extract the month and quarter from the date.
DAX
DailyData =
ADDCOLUMNS (
DailyData,
"Month", MONTH([Day]),
"Quarter", QUARTER([Day]),
"Year", YEAR([Day])
)
Now, you can create measures to calculate the utilization by month and quarter.
DAX
MonthlyUtilization =
CALCULATE (
DIVIDE (
SUM(DailyData[DailyBHours]),
SUMX (
DailyData,
(40 * DailyData[ResourceCount]) - DailyData[DailyNonBHours]
)
),
VALUES(DailyData[Month]),
VALUES(DailyData[Year])
)
DAX
QuarterlyUtilization =
CALCULATE (
DIVIDE (
SUM(DailyData[DailyBHours]),
SUMX (
DailyData,
(40 * DailyData[ResourceCount]) - DailyData[DailyNonBHours]
)
),
VALUES(DailyData[Quarter]),
VALUES(DailyData[Year])
)
Proud to be a Super User! |
|
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
87 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |