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

Be 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

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
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.