动态汇率使用DAX

我想让我的金额根据动态选择的货币代码进行更改。动态汇率使用DAX

在我的FactSales表中我有货币和金额。如果用户想要以任何货币查看该金额,则他从切片机中选择该币种,并且我的开卡汇率将适用于该金额。

我想下面DAX得到动态的汇率,但没有运气:

ExchangeRate = CALCULATE(MIN(ExchangeRate[ExcahngeRate]), FILTER(ExchangeRate, AND(AND(AND(MIN(FactSales[TransDate])>=MIN(ExchangeRate[ValidFrom]), MIN(FactSales[TransDate])<=IF(ISBLANK(MIN(ExchangeRate[ValidTo])), DATEVALUE("01-01-2070"), MIN(ExchangeRate[ValidTo]))), MIN(ExchangeRate[FromCurrencyCode]) = MIN(FactSales[CurrencyCode])), MIN(ExchangeRate[ToCurrencyCode]) = FIRSTNONBLANK(ExchangeRate[ToCurrencyCode],1)))) 

回答:

如果我们每天的基础上的汇率,然后我们可以去下面的解决方案:

enter link description here:https://www.kasperonbi.com/currency-conversion-in-dax-for-power-bi-and-ssas/

如果我们有汇率日期范围,然后使用动态DAX: ExchangeRate = IF(ISBLANK ( CALCULATE(MIN(ExchangeRate[ExcahngeRate]), FILTER(FILTER(ExchangeRate, AND(AND(ExchangeRate[FromCurrencyCode] = MIN(FactSales[TransactionCurrencyCode]), ExchangeRate[ToCurrencyCode] = FIRSTNONBLANK(ExchangeRate[ToCurrencyCode],1)) , MIN(FactSales[TransDate])<=IF(ISBLANK(ExchangeRate[ValidTo].[Date]), DATEVALUE("2070-01-01"), ExchangeRate[ValidTo]))), MIN(FactSales[TransDate])>= ExchangeRate[ValidFrom])) ) , 1 , CALCULATE(MIN(ExchangeRate[ExcahngeRate]), FILTER(FILTER(ExchangeRate, AND(AND(ExchangeRate[FromCurrencyCode] = MIN(FactSales[TransactionCurrencyCode]) , ExchangeRate[ToCurrencyCode] = FIRSTNONBLANK(ExchangeRate[ToCurrencyCode],1)) , MIN(FactSales[TransDate])<=IF(ISBLANK(ExchangeRate[ValidTo].[Date]), DATEVALUE("2070-01-01"), ExchangeRate[ValidTo]))) , MIN(FactSales[TransDate])>= ExchangeRate[ValidFrom])) )

以上是 动态汇率使用DAX 的全部内容, 来源链接: utcz.com/qa/259739.html

回到顶部