<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Dynamic Exchange Rate architecture and DAX calculation in Power BI in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Dynamic-Exchange-Rate-architecture-and-DAX-calculation-in-Power/m-p/315585#M2658</link>
    <description>&lt;P&gt;I want to get my amount to change as per currency code selected dynamically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my FactSales table I have currency and Amount. If user want to see that amount in any currency he select the currency from slicer and my excahnge rate will apply to that amount.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried below DAX to get dynamic Exchange Rate but no luck:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ExchangeRate = CALCULATE(MIN(ExchangeRate[ExcahngeRate]), FILTER(ExchangeRate, AND(AND(AND(MIN(FactSales[TransDate])&amp;gt;=MIN(ExchangeRate[ValidFrom]), MIN(FactSales[TransDate])&amp;lt;=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))))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ExchangeRate = CALCULATE(MIN(ExchangeRate[ExcahngeRate]), FILTER(ExchangeRate, AND(AND(AND(MIN(FactSales[TransDate])&amp;gt;=MIN(ExchangeRate[ValidFrom]), MIN(FactSales[TransDate])&amp;lt;=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))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Solution File (.PBIX)" href=" https://drive.google.com/file/d/1BCD3cycq-tNTc9xPEK458dn-BjJj9Qao/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1BCD3cycq-tNTc9xPEK458dn-BjJj9Qao/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 03 Dec 2017 08:15:50 GMT</pubDate>
    <dc:creator>Rajiv1237</dc:creator>
    <dc:date>2017-12-03T08:15:50Z</dc:date>
    <item>
      <title>Dynamic Exchange Rate architecture and DAX calculation in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Dynamic-Exchange-Rate-architecture-and-DAX-calculation-in-Power/m-p/315585#M2658</link>
      <description>&lt;P&gt;I want to get my amount to change as per currency code selected dynamically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my FactSales table I have currency and Amount. If user want to see that amount in any currency he select the currency from slicer and my excahnge rate will apply to that amount.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried below DAX to get dynamic Exchange Rate but no luck:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ExchangeRate = CALCULATE(MIN(ExchangeRate[ExcahngeRate]), FILTER(ExchangeRate, AND(AND(AND(MIN(FactSales[TransDate])&amp;gt;=MIN(ExchangeRate[ValidFrom]), MIN(FactSales[TransDate])&amp;lt;=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))))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ExchangeRate = CALCULATE(MIN(ExchangeRate[ExcahngeRate]), FILTER(ExchangeRate, AND(AND(AND(MIN(FactSales[TransDate])&amp;gt;=MIN(ExchangeRate[ValidFrom]), MIN(FactSales[TransDate])&amp;lt;=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))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Solution File (.PBIX)" href=" https://drive.google.com/file/d/1BCD3cycq-tNTc9xPEK458dn-BjJj9Qao/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1BCD3cycq-tNTc9xPEK458dn-BjJj9Qao/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Dec 2017 08:15:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Dynamic-Exchange-Rate-architecture-and-DAX-calculation-in-Power/m-p/315585#M2658</guid>
      <dc:creator>Rajiv1237</dc:creator>
      <dc:date>2017-12-03T08:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Exchange Rate architecture and DAX calculation in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Dynamic-Exchange-Rate-architecture-and-DAX-calculation-in-Power/m-p/316054#M2683</link>
      <description>&lt;P&gt;If we have Exchange rate on daily basis then we can go for below solution:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.kasperonbi.com/currency-conversion-in-dax-for-power-bi-and-ssas/" target="_self"&gt;https://www.kasperonbi.com/currency-conversion-in-dax-for-power-bi-and-ssas/&lt;img /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we have Exchange Rate as date range then use dynamic DAX:&lt;/P&gt;&lt;PRE&gt;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])&amp;lt;=IF(ISBLANK(ExchangeRate[ValidTo].[Date]), DATEVALUE("2070-01-01"), ExchangeRate[ValidTo]))), MIN(FactSales[TransDate])&amp;gt;= 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])&amp;lt;=IF(ISBLANK(ExchangeRate[ValidTo].[Date]), DATEVALUE("2070-01-01"), ExchangeRate[ValidTo])))
		, MIN(FactSales[TransDate])&amp;gt;= ExchangeRate[ValidFrom]))
)&lt;/PRE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Dec 2017 08:13:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Dynamic-Exchange-Rate-architecture-and-DAX-calculation-in-Power/m-p/316054#M2683</guid>
      <dc:creator>Rajiv1237</dc:creator>
      <dc:date>2017-12-03T08:13:54Z</dc:date>
    </item>
  </channel>
</rss>

