Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am trying to create a calculated column, but I need to do 2 different calculations based on ID number. I have a table of the Exempt ID numbers, a table with the Employee data, and a table that contains the actual data values.
Table Names
Exempt Employees - table that includes ID numbers that I want to do a different calculation for.
Employee Data - table that contains employee information and connects all the data sources
Main - table that includes the data values by employee number.
Pretty much, I want to have 2 sets of calculations based on if their ID number is in the Exempt Employee Table.
What is the best way to do this? I can also change the relationships between the 3 tables if there is a solution that way too.
Solved! Go to Solution.
Hi @jasmin_w
For your question, here is the method I provided:
Here's some dummy data
“Exempt Employees”
“Employee”
“Main”
Relationships between tables.
Create a Calculated Column. This function queries whether the ID returned from the Exempt Employees table is a relevant value indicating that the employee is exempt.
Salary Calculation =
var _isExempt =
NOT(
ISBLANK(
RELATED('Exempt Employees'[ID])
)
)
RETURN
IF(
_isExempt,
('Main'[Base Salary] * 'Main'[Multiplier] * 0.8) / 4,
('Main'[Base Salary] * 'Main'[Multiplier] ) / 4
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
In which of those 3 tables do you want to write those formulas? Share the download link of the PBI file.
Hi @jasmin_w
For your question, here is the method I provided:
Here's some dummy data
“Exempt Employees”
“Employee”
“Main”
Relationships between tables.
Create a Calculated Column. This function queries whether the ID returned from the Exempt Employees table is a relevant value indicating that the employee is exempt.
Salary Calculation =
var _isExempt =
NOT(
ISBLANK(
RELATED('Exempt Employees'[ID])
)
)
RETURN
IF(
_isExempt,
('Main'[Base Salary] * 'Main'[Multiplier] * 0.8) / 4,
('Main'[Base Salary] * 'Main'[Multiplier] ) / 4
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much. This worked perfectly!
User | Count |
---|---|
91 | |
73 | |
68 | |
63 | |
55 |
User | Count |
---|---|
98 | |
89 | |
73 | |
62 | |
61 |