Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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,
User | Count |
---|---|
72 | |
66 | |
34 | |
25 | |
22 |
User | Count |
---|---|
96 | |
94 | |
58 | |
45 | |
42 |