<?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: Lookupvalue based on variable slicer selection showing blanks ? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-based-on-variable-slicer-selection-showing-blanks/m-p/737359#M2103</link>
    <description>&lt;P&gt;Could you explain what you are trying to do with the var function now?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I managed to get it to work. I used lookupvalue on the wrong column which was not in the same format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However =&amp;gt; Is there an easier or prettier way to make this formula variable? Cause now if I would have a new currency in my selection, I would have to manually update my formula here:&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;=VAR selection = [Selected_Currency_reported]&lt;/P&gt;&lt;P&gt;return&lt;/P&gt;&lt;P&gt;switch(true();&lt;/P&gt;&lt;P&gt;selection = "CHF";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "CZK"; SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "EUR";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "GBP";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "HUF";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));"Incorrect values")&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2019 08:13:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-11T08:13:54Z</dc:date>
    <item>
      <title>Lookupvalue based on variable slicer selection showing blanks ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-based-on-variable-slicer-selection-showing-blanks/m-p/736673#M2071</link>
      <description>&lt;P&gt;Hi, I am trying to make a report in PowerPivot where I dynamically select a reporting currency, and with a variable measure this will multiply my amount in SEK to any currency that I select in the slicer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have multiple currencies in my fact table (see tables below) and have converted those already to one global SEK amount which you can see in the "SEK amount" column. So the only thing left is to convert this SEK amount based on the currency I select in a slicer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Facts table is already linked with the exchange rate table through the "Currency Key".&lt;/P&gt;&lt;P&gt;However to make this work I created an extra table with all the reported currencies which is not linked to any table so that I can create the following measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Selected_Currency_reported:&lt;/P&gt;&lt;P&gt;=if(HASONEVALUE('Dim Currencies'[Currency]);VALUES('Dim Currencies'[Currency]);BLANK())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then for the conversion measure below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I select GBP it is returning "test" which it should be as I did not yet include that currency to be selected.&lt;/P&gt;&lt;P&gt;However, I am getting blank values when multiplying my SEK amount with the looked-upvalue (or at least I think it selects a rate) exchange rate from the table. When I try to divide by the lookupvalue it gives a "NUM"-error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure itself is working without any initial error, but somehow it is only returning me blanks when I select a relevant currency. Can anyone see what I'm doing wrong here?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=VAR selection = [Selected_Currency_reported]&lt;/P&gt;&lt;P&gt;return&lt;/P&gt;&lt;P&gt;switch(true();&lt;/P&gt;&lt;P&gt;selection = "CHF";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[currency key date];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "CZK"; SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[currency key date];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "EUR";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[currency key date];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "HUF";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[currency key date];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));BLANK())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following Exchange rate table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 15:15:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-based-on-variable-slicer-selection-showing-blanks/m-p/736673#M2071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T15:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Lookupvalue based on variable slicer selection showing blanks ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-based-on-variable-slicer-selection-showing-blanks/m-p/737169#M2101</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; your formula looks ok not sure what is missig, why not replace following to var&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;selection = "CHF";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];&lt;BR /&gt;'Dim Exchange rates'[Datekey];'Fact PL Data'[currency key date];'Dim Exchange rates'[Currency];&lt;FONT color="#ff0000"&gt;selction&lt;/FONT&gt;));&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jul 2019 05:41:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-based-on-variable-slicer-selection-showing-blanks/m-p/737169#M2101</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-07-11T05:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lookupvalue based on variable slicer selection showing blanks ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-based-on-variable-slicer-selection-showing-blanks/m-p/737359#M2103</link>
      <description>&lt;P&gt;Could you explain what you are trying to do with the var function now?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I managed to get it to work. I used lookupvalue on the wrong column which was not in the same format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However =&amp;gt; Is there an easier or prettier way to make this formula variable? Cause now if I would have a new currency in my selection, I would have to manually update my formula here:&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;=VAR selection = [Selected_Currency_reported]&lt;/P&gt;&lt;P&gt;return&lt;/P&gt;&lt;P&gt;switch(true();&lt;/P&gt;&lt;P&gt;selection = "CHF";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "CZK"; SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "EUR";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "GBP";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));&lt;BR /&gt;selection = "HUF";SUMX('Fact PL Data';'Fact PL Data'[SEK amount]*LOOKUPVALUE('Dim Exchange rates'[Exch. Rate];'Dim Exchange rates'[Datekey];'Fact PL Data'[Datekey currency];'Dim Exchange rates'[Currency];[Selected_Currency_reported]));"Incorrect values")&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 08:13:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-based-on-variable-slicer-selection-showing-blanks/m-p/737359#M2103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-11T08:13:54Z</dc:date>
    </item>
  </channel>
</rss>

