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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
CJensen
Helper I
Helper I

Getting currency from another table

Hi 

I have a bit of a problem, that I cant solve myself.

 

I have a salestable with sales but no exchange rate in that table. I have the currency in anothertable, but I cant seem to retrieve the exchange rate with lookupvalue. 

 

I get an "multiple" values error. I think it is because the exchange rate table dates only have the specifik dates and not the exact date, like the calender table. I have no idea how to add the missing dates and get the exchange rates filled out with the last non blank. 

 

Can you please help ?Model.pngExchange.png

 

 

 

 

1 ACCEPTED SOLUTION

Hi @CJensen ,

 

In your sample, we cannot get anything by Vlookup function  as there is no matching rows in both tables. So We can create calculated column using following DAX.

 

ExchangeRate =
VAR cu = [Currency]
VAR t =
    FILTER (
        ALL ( ExchangeRates ),
        AND (
            [Posting Date] >= ExchangeRates[FROMDATE],
            [Posting Date] <= ExchangeRates[LASTCHANGED]
        )
    )
VAR result =
    FILTER ( t, [Currency] = cu )
RETURN
    MAXX ( result, [EXCHRATE] )

 

But I do not know what time column you want to use in sales table, so I use positon date in your DAX to do this example.

 

BTW, pbix as attached.

 

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

Community Support Team _ Dong Li
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

4 REPLIES 4
v-lid-msft
Community Support
Community Support

Hi @CJensen ,

 

It seems there is a date key column in ExchangeRatesTable. If the relations between DateTable and ExchangeRatesTable bases on the datekey column, you can try to make the relation between SalesTable and DateTable in both way, then use the lookupValue function again.

 

If it doesn't meet your requirement, kindly share your DAX formula to me if you don't have any Confidential Information.

 

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

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

Hi @v-lid-msft 

 

Thank you so much for your reply. Ive tried changing it. And cant get it to work. 

 

Ive attached the .pbix file with demo data, so you can see it. 

 

.Pbix

Hi @CJensen ,

 

In your sample, we cannot get anything by Vlookup function  as there is no matching rows in both tables. So We can create calculated column using following DAX.

 

ExchangeRate =
VAR cu = [Currency]
VAR t =
    FILTER (
        ALL ( ExchangeRates ),
        AND (
            [Posting Date] >= ExchangeRates[FROMDATE],
            [Posting Date] <= ExchangeRates[LASTCHANGED]
        )
    )
VAR result =
    FILTER ( t, [Currency] = cu )
RETURN
    MAXX ( result, [EXCHRATE] )

 

But I do not know what time column you want to use in sales table, so I use positon date in your DAX to do this example.

 

BTW, pbix as attached.

 

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

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

Hi @v-lid-msft thank yo so much for your help, it was exatly what I needed !! 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.