The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance 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 |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |