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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Lookup to access a value within two dates

 

Hi,

 

I have a currency rate master of the exchange rates for a specific time period. The time period is defined by the "To Date" and the "From Date".

 

There is another table with Job details including their billing amount and billing currency.  I need to access the respective rate for the respective currency in each row in the job table and store in an "exchange_rate" column in job table.

 

I have tried the following approach:

 

CurrencyRate = CALCULATE(VALUES(CurrencyMaster[Rate]),FILTER(CurrencyMaster,CurrencyMaster[Currency Name] = Job[Billing Currency]),FILTER(CurrencyMaster,Job[Job Created Date]<= CurrencyMaster[To Date] && Job[Job Created Date]>=CurrencyMaster[From Date]))

 

But i'm getting the following error:

A table of multiple values was supplied where a single value was expected.

Not sure whether the approach is correct. Any suggesstions?

 

Sample Data

 

 

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

The VALUES returns a table. That's the cause of the error. Try this one, please. If there are blank values, you could know there is something wrong. For example, there are two lines in the same period.

 

Column =
CALCULATE (
    SELECTEDVALUE ( CurrencyMaster[Rate] ),
    FILTER (
        CurrencyMaster,
        CurrencyMaster[From Date] <= [Job Created Date]
            && CurrencyMaster[To Date] >= [Job Created Date]
            && CurrencyMaster[Currency Name] = Job[Billing Currency]
            && CurrencyMaster[Status] = "Active"
    )
)

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

The VALUES returns a table. That's the cause of the error. Try this one, please. If there are blank values, you could know there is something wrong. For example, there are two lines in the same period.

 

Column =
CALCULATE (
    SELECTEDVALUE ( CurrencyMaster[Rate] ),
    FILTER (
        CurrencyMaster,
        CurrencyMaster[From Date] <= [Job Created Date]
            && CurrencyMaster[To Date] >= [Job Created Date]
            && CurrencyMaster[Currency Name] = Job[Billing Currency]
            && CurrencyMaster[Status] = "Active"
    )
)

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.