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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
unclejemima
Post Patron
Post Patron

lookupvalue function with 2 columns?

I've got a table called trandata what has a column called CurrencyDate, and CurrencyCode

 

There is another tabled called CurRates what has a RateDate and CurrencyCode, and the value I want called SellRate

 

The CurRates table has unique values in it for each CurrencyCode (values 1-5) and then the Date (RateDate) to give the sellrate (example 1.45)

 

I'm trying to make a calculated column in trandata called CurrencyRate using the lookupvalue function to retreuve the CurRates[SellRate]...but because I'm trying to match two columns I'm not sure how to write the DAX.

 

I'm trying to lookup the trandata[CurrencyDate] and trandata[CurrencyCode], reference the CurRates[RateDate] and CurRates[CurrecnyCode] to then display the CurRates[SellRate] in Trandata calculated column CurrencyRate.

 

Can anyone elighten me on a formula for this?

 

Thanks!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Could you create a concatinated column in your CurRates table that brings together the RateDate and CurCode?  Then when you do your Lookup, make the lookup value a concatination of CurrencyDate and CurrencyCode?

 

You might need to check that they format to create the same string, but it should work.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Could you create a concatinated column in your CurRates table that brings together the RateDate and CurCode?  Then when you do your Lookup, make the lookup value a concatination of CurrencyDate and CurrencyCode?

 

You might need to check that they format to create the same string, but it should work.

I was thinking this too...but because its a whole number and date value I thought it might give an odd result.  I'll try it out 🙂

 

Thanks!!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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