Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I created two measures that calculate the Utilization hours %. One department calculates it differently so I created a separate measure for their department. I have both values shown in a table but I only want one column for [Utilized %] depending on the employees department. I feel I could accomplish this with one measure but I am having a hard time filtering department in a measure
If department = "Service" then use [Utilized % Adjusted] else [Utilized %]
Measures
Utilized % = DIVIDE(SUM('Time Entry'[Hours Utilized]), SUM('Time Entry'[Hours Actual]), 0)
Utilized % Adjusted = DIVIDE(SUM('Time Entry'[Utilized Hours Service Desk]), SUM('Time Entry'[Hours Actual]), 0)
This is the results I am looking for
Hi @rachaelwalker,
I'd like to suggest you take a look at the following blog to know how to pick up the current row context value:
Using the SELECTEDVALUE function in DAX - SQLBI
The you can use compare with the current value and specific value and use in if statement to work as conditions.
Regards,
Xiaoxin Sheng
Append that 2 tables, and make sure that [Hours Utilized] (of other department) and [Utilized Hours Service Desk] fall into the same column in the appended table.
Please try pulling the following measure onto your table visual.
Select Measure =
VAR CurrentDepartment = MAX(Table[Department])
VAR Result =
IF(
CurrentDepartment = "Service",
[Utlizized % Adjusted],
[Utilized %]
)
RETURN Result
Regards,
Nathan
User | Count |
---|---|
23 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |