Calculating Value taking data from different tables on condition
I have data from two tables that I want to mix in a matrix column, it only takes information from one table per row, a central table with a condition decides which table to take the data from (Picture Below)
I have three tables that are used to calculate the hourly sale rate of an employee.
Table 1 : Fixed Rate
This table contains the employee and a fixed hourly sale rate
Table 2: Hourly rate per package
The hours of this employee are sold in packages and each package has an amount of hours and it can have a different rate per package
Table 3: Central Table
This tables contains the employee and which kind of hourly rate to apply
Table 4 : Employee Table ( Contains only employee data)
I have calculated two measures in order to calculate the average hourly sale rate, one for table 1 and one for table 2 . I want to use a measure that takes data from the calculated measure for table 1 when the employee belongs to the fixed hourly rate table, and from measure 2 when the employee belongs to the hours sold in packages ( table 2).