Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Looking up rates

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 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Gah

 

Measure = sumx('Staff','Staff'[Total Hours worked] * RELATED('Rates'[ Per Hour]))

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Gah

 

Measure = sumx('Staff','Staff'[Total Hours worked] * RELATED('Rates'[ Per Hour]))

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.