简体   繁体   English

Power Bi - 货币类型过滤器

[英]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:我在 Transaction 表(TransactionAmount 和 TransactionCurrency 列)以及相关的 Currency 表中有多种货币的交易:

在此处输入图片说明

Using the column RateToEuro I have been able to convert all my transaction amounts, using a calculate column, into euros:使用列 RateToEuro 我已经能够使用计算列将我所有的交易金额转换为欧元: 在此处输入图片说明

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.因此,在我上面的示例中,“交易金额 ($)”列中的 2052 美元原始 trx 金额也将是 2052 美元。

[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).但出于某种原因, IF语句始终返回TRUE (即始终使用RateToEuro列)。

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.目前,这在 Power BI 中是不可能的:不支持计算列使用切片器值。

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.可以使用度量来获取切片器值,但在这种特殊情况下(如果需要计算每一行的一个值),不幸的是没有可能的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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