<?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 Re: DAX - Selected slicer/value and row in data column are same, then give a certain output in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Selected-slicer-value-and-row-in-data-column-are-same-then/m-p/734327#M1920</link>
    <description>&lt;P&gt;With this comes another issue&lt;/P&gt;&lt;P&gt;=&amp;gt; I checked my Exchange rate data and I am actually missing exchange rates for some transactions =&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example CZK to CHF currency I do not have any rates for some dates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could there be an easy workaround for this? Like taking the average of a previous period instead of having a blank calculation? Or going from CZK to EUR and then finding the EUR/CHF rate? But my Dax knowledge is super limited so no idea how to set this up....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2019 15:17:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-08T15:17:42Z</dc:date>
    <item>
      <title>DAX - Selected slicer/value and row in data column are same, then give a certain output</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Selected-slicer-value-and-row-in-data-column-are-same-then/m-p/734258#M1912</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm very new to Dax and I'm building a model in PowerPivot (which I will use in PowerBi when finished).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a financial report where I'm converting multiple currencies to one reporting currency which is selected by a slicer. It is set up as in the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.kasperonbi.com/currency-conversion-in-dax-for-power-bi-and-ssas/" target="_blank"&gt;https://www.kasperonbi.com/currency-conversion-in-dax-for-power-bi-and-ssas/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an Exchange Rate table set up. However for each day I am missing the currency rate where the "From currency" is the same as the "to currency" =&amp;gt; So where my Exchange rate needs to be 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought of adding lines into my table but this would mean adding thousands of lines for multiple currencies on multiple dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought of creating a dax formula where I can say =&amp;gt; If the row in the facts table (can be any currency) is the same the reported (selected with slicer) currency, then I want the amount in the row to be multiplied by 1. Otherwise I want the row to be multiplied by the actual exchange rate.&amp;nbsp; (see a pivot example below where the issue occurs when EUR to EUR is reported)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current measures are like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;TrnExchangeRate=MIN('Dim Exchange rates'[Exch. Rate])&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This will get the lowest factor value from the fact table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now to calculate the sales per transaction I will use SUMX to achieve this:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;TotalSales = =IF(HASONEVALUE(ReportCurrency[ReportCurrency]);SUMX('Fact PL Data';'Fact PL Data'[Amount in local currency]*[TrnExchangeRate]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However if my currency in PL DATA is "EUR" for example, and my reporting currency is also "EUR", then I currently get a blank value. Because I never have 1 as an exchange rate in my table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the easiest dax formula to solve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or would you recommend me adding all these in the exchange rate table for each day?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:29:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Selected-slicer-value-and-row-in-data-column-are-same-then/m-p/734258#M1912</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-08T14:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Selected slicer/value and row in data column are same, then give a certain output</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Selected-slicer-value-and-row-in-data-column-are-same-then/m-p/734285#M1914</link>
      <description>&lt;P&gt;I was googling around in the meantime and thought I could do it like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=if(ISBLANK('Dim Exchange rates'[Min of Exch. Rate]);1;MIN('Dim Exchange rates'[Exch. Rate]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I think this is not best practice. Because if I will have some dates where I actually do not have any exchange rate data between different currencies, then I will probably get 1 as an exchange rate, instead of an actual blank...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:45:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Selected-slicer-value-and-row-in-data-column-are-same-then/m-p/734285#M1914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-08T14:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Selected slicer/value and row in data column are same, then give a certain output</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Selected-slicer-value-and-row-in-data-column-are-same-then/m-p/734327#M1920</link>
      <description>&lt;P&gt;With this comes another issue&lt;/P&gt;&lt;P&gt;=&amp;gt; I checked my Exchange rate data and I am actually missing exchange rates for some transactions =&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example CZK to CHF currency I do not have any rates for some dates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could there be an easy workaround for this? Like taking the average of a previous period instead of having a blank calculation? Or going from CZK to EUR and then finding the EUR/CHF rate? But my Dax knowledge is super limited so no idea how to set this up....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:17:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Selected-slicer-value-and-row-in-data-column-are-same-then/m-p/734327#M1920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-08T15:17:42Z</dc:date>
    </item>
  </channel>
</rss>

