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.
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?
Solved! Go to Solution.
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,
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,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |