简体   繁体   中英

Power Bi - Filter on currency type

I have transactions in a variety of currencies in a Transaction table (columns TransactionAmount and TransactionCurrency), and also a related Currency table:

在此处输入图片说明

Using the column RateToEuro I have been able to convert all my transaction amounts, using a calculate column, into euros: 在此处输入图片说明

An example of what I would like: I want to select in my report filter 'Dollar' and then the Transaction amount should convert all original transaction amounts to dollars. So in my example above, the $2052 original trx amount will be 2052 also in the 'Transaction amount ($)' column.

[EDIT:] Currently I have created measure that gets the filter value:

CurrencyFilter = IF(LASTNONBLANK('CurrencyFormat'[Name], 1) = "USD", "USD", "EUR")

And a calculated column that for each transaction calculates the converted transaction amount (depending on the report filter chosen):

TransactionAmountConverted = CALCULATE(VALUES(Transactions[TransactionAmount]) * (IF([CurrencyFilter] = "EUR", VALUES('Currency'[RateToEuro]), VALUES('Currency'[RateToDollar]))))

But for some reason the IF statement always returns TRUE (ie always uses the RateToEuro column).

Any hint or tip to point me in the right direction would be much appreciated!

Currently this is not possible in Power BI: it is not supported that a calculated column uses a slicer value.

A measure can be used to get the slicer value, but in this particular case (if one value for each row is required to be calculated), there is no solution possible unfortunately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM