March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi.
I have two tables of data. One is the currency, year and exchange rate "ExchangeRates" the other is "Invoices" with colums for year, net amount and currency code. I have tried so many different formulas - all the ones I would use in excel don't seem to work! and keep hitting errors. The latest one I get is: a single value cannot be determined...
My question is how do I create a calculation which does does a currency conversion using the exchange rate in a set year from the "exchangeRates" table and then calculates this against the invoice amount?
many thanks for any help
Solved! Go to Solution.
Converted amount =
SUMX (
Invoices,
Invoices[Net amount]
* LOOKUPVALUE (
ExchRate[Rate],
ExchRate[Currency code], Invoices[Currency code],
ExchRate[Year], Invoices[Year]
)
)
Converted amount =
SUMX (
Invoices,
Invoices[Net amount]
* LOOKUPVALUE (
ExchRate[Rate],
ExchRate[Currency code], Invoices[Currency code],
ExchRate[Year], Invoices[Year]
)
)
I just tried this and get the following error: Function 'LOOKUPVALUE' does not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
yes, because YearCode in your table is of type "String" (text in PowerQuery) -> change it to integer (number in powerquery)
nks for your quick response. Now I get this error: A table of multiple values was supplied where a single value was expected. Any ideas what I need to change?
it looks like you have multiple entries for the same combination of year and currency code.
Thanks for your help.
ConvertedSum =
VAR InvoiceDate = SELECTEDVALUE(Invoices[InvoiceDate])
VAR Currency = SELECTEDVALUE(Invoices[Curreny])
VAR ConversionRate =
CALCULATE(
MIN(ConversionRates[rate]),
ConversionRates[currency] = Currency,
ConversionRates[cear] = YEAR(InvoiceDate)
)
RETURN SUM(Invoices[Invoices - Net amount]) * ConversionRate
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
73 | |
57 | |
52 |
User | Count |
---|---|
197 | |
133 | |
107 | |
69 | |
65 |