March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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]))
User | Count |
---|---|
117 | |
77 | |
58 | |
52 | |
46 |
User | Count |
---|---|
171 | |
117 | |
63 | |
57 | |
51 |