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
mdex
Resolver I
Resolver I

Lookupvalue no longer working - A table of multiple values was supplied error

After my latest data refresh one of my formula is no longer working. DTO Rates hasn't changed but we have more lines in TRSBookings

 

It's probably overcomplicated but I want to compare the custom columns from 2 TRSBookings and DTO Rates then return the DTO Rates[Rate], if the custom doesn't provide a match then compare only the TRS/Request_No, if no match on either the value should be blank/0/null.

 

DTORate = if(IFERROR(LOOKUPVALUE('DTO Rates'[Rate],'DTO Rates'[Custom],TRSBookings[Custom]),LOOKUPVALUE('DTO Rates'[Rate],'DTO Rates'[TRS],TRSBookings[REQUEST_NO])) =0,LOOKUPVALUE('DTO Rates'[Rate],'DTO Rates'[TRS],TRSBookings[REQUEST_NO]),LOOKUPVALUE('DTO Rates'[Rate],'DTO Rates'[Custom],TRSBookings[Custom]))
 
Example data
 
TRSBookings
Request_NoTeam_IDCustomDTORate
R0422581100R042258 1100715.62
R0415061192R041506 1192533.89
R0415061198R041506 1198408.5
R0411011198R041101 1198 
R0415061192R041506 1192533.89

 

DTO Rates

TRSTeam_IDCustomRate
R042258  715.62
R0415061192R041506 1192533.89
R0415061198R041506 1198408.5

 

Could someone please help or point me in the right direction?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mdex , create a new column in TRSBookings

 

maxx(filter('DTO Rates', 'DTO Rates'[TRS]= TRSBookings[REQUEST_NO && 'DTO Rates'[Custom] =TRSBookings[Custom] && 'DTO Rates'[Team_ID] =TRSBookings[Team_ID]),'DTO Rates'[Rate])

 

if need you can remove Team_ID if not needed

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@mdex , create a new column in TRSBookings

 

maxx(filter('DTO Rates', 'DTO Rates'[TRS]= TRSBookings[REQUEST_NO && 'DTO Rates'[Custom] =TRSBookings[Custom] && 'DTO Rates'[Team_ID] =TRSBookings[Team_ID]),'DTO Rates'[Rate])

 

if need you can remove Team_ID if not needed

Hi Amit,

 

Thanks for taking a look. I realise there was a slight discrepany with my example data. DTO Rate column is being calculated in TRSBookings I incorrectly had this in the table as rate.

The rate for R042258 was also missing from both tables. The view you see if my expected result.

 

Your formula works ok where custom columns match, but if no custom match then just the TRS/Request_NO should be compared.

 

Hope this makes sense.

 

EDIT: Think I have it!

 

DTORate = IF(maxx(filter('DTO Rates', 'DTO Rates'[Custom] =TRSBookings[Custom]),'DTO Rates'[Rate]) = 0,maxx(filter('DTO Rates', 'DTO Rates'[TRS]= TRSBookings[REQUEST_NO] ),'DTO Rates'[Rate]),maxx(filter('DTO Rates', 'DTO Rates'[Custom] =TRSBookings[Custom]),'DTO Rates'[Rate]))

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.

Top Solution Authors