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

If lookup formula error comparing text with value type

Hi Experts

 

I am getting an error with the following measure =

IF(FACTSalesOrderTable[Ccy]="APP", DIVIDE(FACTSalesOrderTable[discount_amount],LOOKUPVALUE(ExchangeRate[Exchange Rate],ExchangeRate[Currency],FACTSalesOrderTable[Ccy]="APP"),0),""))
 
Alternatively i could add columns Currency and Ex Rate into FACT Sales and then do the divide based on what the [Ccy] equals
 
The Exchange Rate Table
IndexCurrencyExchange RateStoreID
1GBP1.001
2APP1.005
3IRE1.136
4APP IRE1.758
5AUD1.132
6EUR1.133
7USD1.304
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Not very clear. Is this result you want? If not, please add more information.

v-xiaotang_0-1621220087047.png

Measure:

Measure =
DIVIDE(SELECTEDVALUE(FACTSalesOrderTable[discount_amount]),SELECTEDVALUE(ExchangeRate[Exchange Rate]))

Besides, you need to create a relationship between 2 tables. FYI: https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-create-and-manage-relationships

v-xiaotang_2-1621220364789.png

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Not very clear. Is this result you want? If not, please add more information.

v-xiaotang_0-1621220087047.png

Measure:

Measure =
DIVIDE(SELECTEDVALUE(FACTSalesOrderTable[discount_amount]),SELECTEDVALUE(ExchangeRate[Exchange Rate]))

Besides, you need to create a relationship between 2 tables. FYI: https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-create-and-manage-relationships

v-xiaotang_2-1621220364789.png

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Many Thanks Team Tang....Could you kindly have a look this question for 2 days ... please

https://community.powerbi.com/t5/Desktop/TRICKY-Previous-Value/td-p/1844485

 

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.