Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have three tables
Rates:
Rate ID, Rate, Per Hour
1, A, 10
2, B, 20
3, C, 30
Staff
Staff ID, Name, Rate
1, Bob, A
2, Fred, B
3, Shelly, C
4, George, C
Timesheet
Timesheet ID, Staff ID, Hours
1, 1, 30
2, 2, 30
3, 2, 30
4, 1, 60
5, 3, 30
6, 4, 60
I am using
Total Hours worked = Calculate(SUM(Timesheet[Hours]),Filter(all('Timesheet'),'Timesheet'[Staff ID]=Staff[Staff ID]))
To look up my hours and total them
I'm trying to lookup the rates from the rate table
Rate Per Hr = LOOKUPVALUE(Rates[ Per Hour],Rates[Rates],Staff[Rate])
But I get an error about single values. Not sure what I'm doing wrong on this one! Any help? I've been using PowerBI for about two days and not really done a lot of DAX.
Frankly, I don't need to replicate the data in the table from Rates, just do the calculation which is total hous worked * hourly rate
Solved! Go to Solution.
Gah
Measure = sumx('Staff','Staff'[Total Hours worked] * RELATED('Rates'[ Per Hour]))
Gah
Measure = sumx('Staff','Staff'[Total Hours worked] * RELATED('Rates'[ Per Hour]))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |