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

LOOKUPVALUE or another formula?

Good day,

 

I am trying to create a caluclated column, which pulls in a value "conversion rate" from a currency conversion rate table, based on a specified date, and the currency code (Cdn, AUD etc). There is no link between the two tables, as they do not share any unique identifiers.

 

 

In order for the correct conversion rate to be pulled, the "Close Date" from the original Opportunity table has to fall within a range "Start Date" - "Next Start Date" in the currency table. In addition, the Currency ISO codes between the two tables must also match. Here is the syntax that I tried, but it returns an error: A table of multiple values was supplied where a single value was expected. 

 

Being new to Power BI, I am not sure if this is even the correct approach? Any advice would be appreciated!

 

//

Conversion Rate = if(and('Opportunity Product_ACVe'[Close Date]>=related('Dated Conversion Rate'[StartDate]),'Opportunity Product_ACVe'[Close Date]<=related('Dated Conversion Rate'[NextStartDate])),(LOOKUPVALUE('Dated Conversion Rate'[ConversionRate],'Dated Conversion Rate'[IsoCode],'Opportunity Product_ACVe'[CurrencyIsoCode])),0)

//

 

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

Based on error message, it seems like you formula can find out multiple records based on above conditions.
Current calculated column and measures not support stored multiple records, I think you need to modify your formula to cut down the result amount or use CONCATENATE function to merge them to string.

 

Can you please share some sample data to test? it will be help for troubleshooting your scenario.

 

Regards,

Xiaoxin Sheng

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Good day

 

I am trying to pull the correct currency exchange rate given a specific date that falls under a date range in the destination table, and a specific currency code. The two tables are not related. This is the syntax I tried, but it returns an error: A table of multiple values was supplied where a single value was expected.

 

Any help would be greatly appreciated!

 

Conversion Rate = if(and('Opportunity Product_ACVe'[Close Date]>=related('Dated Conversion Rate'[StartDate]),'Opportunity Product_ACVe'[Close Date]<=related('Dated Conversion Rate'[NextStartDate])),(LOOKUPVALUE('Dated Conversion Rate'[ConversionRate],'Dated Conversion Rate'[IsoCode],'Opportunity Product_ACVe'[CurrencyIsoCode])),0)

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.