LookupValue help or alternative

I need help to find a way to retrive a value from a Lookup table.

To simplify.

I am doing some calculation on my TimeSheetEntry, and this calculation need to be multiply by [DefaultHourlyRate] from my lookup table (TimeSheetuser)

My approach was use a lookupvalue as I can not use Related because of the direction of the relationship (many to 1)

DefaulRate =
LOOKUPVALUE (
TimeSheetUser[DefaultHourlyRate],
TimeSheetUser[User], VALUES ( timesheetentry[timesheetuser] )
)

Screenshot_1

Thank in advance for your help

@ezenunez ,

LOOKUPVALUE should work fine here. The problem is your use of VALUES, which returns all of the unique values in the specified column. For LOOKUPVALUE to work properly the third term needs to be a unique scalar value. Thus if DefaulRate is a calculated column, you can just strike VALUES and it should work because you have row context within the calculated column. If it is a measure, you will need to replace VALUES with SELECTEDVALUE to return a single value.

I hope this is helpful.

– Brian

Thanks for your help Brian.
As per recomendaton, I have change to SELECTEDVALUE and it works!
Thank you.

1 Like