<?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 How do I correct this DAX to add a filter? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-correct-this-DAX-to-add-a-filter/m-p/3074930#M106885</link>
    <description>&lt;P&gt;In the measure below, I have reused the DAX expression in blue which is working elsewhere in my model just fine.&amp;nbsp; I want to now add a filter (i.e., [CATEGORY] &amp;lt;&amp;gt; "Dateline"), but don't have the DAX syntax correct because now I am getting this "LOOKUPVALUE' usage error.&lt;BR /&gt;&lt;BR /&gt;I cannot figure out what the correct syntax is.&amp;nbsp; Any help on this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2023 15:34:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-02-10T15:34:44Z</dc:date>
    <item>
      <title>How do I correct this DAX to add a filter?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-correct-this-DAX-to-add-a-filter/m-p/3074930#M106885</link>
      <description>&lt;P&gt;In the measure below, I have reused the DAX expression in blue which is working elsewhere in my model just fine.&amp;nbsp; I want to now add a filter (i.e., [CATEGORY] &amp;lt;&amp;gt; "Dateline"), but don't have the DAX syntax correct because now I am getting this "LOOKUPVALUE' usage error.&lt;BR /&gt;&lt;BR /&gt;I cannot figure out what the correct syntax is.&amp;nbsp; Any help on this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 15:34:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-correct-this-DAX-to-add-a-filter/m-p/3074930#M106885</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-10T15:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I correct this DAX to add a filter?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-correct-this-DAX-to-add-a-filter/m-p/3075653#M106921</link>
      <description>&lt;P&gt;hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please paste your code as text firstly&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2023 00:04:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-correct-this-DAX-to-add-a-filter/m-p/3075653#M106921</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-11T00:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I correct this DAX to add a filter?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-correct-this-DAX-to-add-a-filter/m-p/3076179#M106952</link>
      <description>&lt;P&gt;If I am not mistaken (it's a screenshot and has inconvenient formating) the SWITCH statement is the second argument to your CALCULATE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE arguements (after the first) should be true/false tables that are used a s filter context for the calculation. Your SWITCH does not return a true/false table, it returns a number, e.g. 13.&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;So your CALCULATE is equivalent to:&lt;BR /&gt;CALCULATE( FILTER (...,...), 13)&lt;/P&gt;&lt;P&gt;This is the error, described in the yellow error message as well.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2023 17:38:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-correct-this-DAX-to-add-a-filter/m-p/3076179#M106952</guid>
      <dc:creator>nchr</dc:creator>
      <dc:date>2023-02-11T17:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I correct this DAX to add a filter?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-correct-this-DAX-to-add-a-filter/m-p/3083445#M107608</link>
      <description>&lt;P&gt;Here is the code.&amp;nbsp; What I am trying to accomplish is to have the SWITCH statement calculate for all the categories except the Dateline (which I have to include in the visual-level slicer because that category is used elsewhere in the visual on a secondary axis).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Amount SC Switch 2 =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; filter('Final Spend', 'Final Spend'[CATEGORY] &amp;lt;&amp;gt; "Dateline"),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SWITCH(TRUE(),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAXx('Final Spend', [Project Status])="Approved", sumx(FILTER('Final Spend','Final Spend'[Project Status] = "Approved"&amp;amp;&amp;amp;'Final Spend'[CATEGORY]&amp;lt;&amp;gt;"Dateline"),'Final Spend'[Amount USD])*(-1)*LOOKUPVALUE('Currency_Exchange_Rate'[ExchRate],'Currency_Exchange_Rate'[Currency],max('Currency_Exchange_Rate'[Currency])),&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAXx('Final Spend', [Project Status])="Completed", sumx(FILTER('Final Spend','Final Spend'[Project Status] = "Completed"&amp;amp;&amp;amp;'Final Spend'[CATEGORY]&amp;lt;&amp;gt;"Dateline"),'Final Spend'[Amount USD])*(-1)*LOOKUPVALUE('Currency_Exchange_Rate'[ExchRate],'Currency_Exchange_Rate'[Currency],max('Currency_Exchange_Rate'[Currency])),&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAXx('Final Spend', [Project Status])="Intake", sumx(FILTER('Final Spend','Final Spend'[Project Status] = "Intake"&amp;amp;&amp;amp;'Final Spend'[CATEGORY]&amp;lt;&amp;gt;"Dateline"),'Final Spend'[Amount USD])*LOOKUPVALUE('Currency_Exchange_Rate'[ExchRate],'Currency_Exchange_Rate'[Currency],max('Currency_Exchange_Rate'[Currency])),&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAXx('Final Spend', [Project Status])="Prioritized", sumx(FILTER('Final Spend','Final Spend'[Project Status] = "Prioritized"&amp;amp;&amp;amp;'Final Spend'[CATEGORY]&amp;lt;&amp;gt;"Dateline"),'Final Spend'[Amount USD])*LOOKUPVALUE('Currency_Exchange_Rate'[ExchRate],'Currency_Exchange_Rate'[Currency],max('Currency_Exchange_Rate'[Currency]))&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 14:12:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-correct-this-DAX-to-add-a-filter/m-p/3083445#M107608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-16T14:12:10Z</dc:date>
    </item>
  </channel>
</rss>

