<?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: Error in Calculate filter argument in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-Calculate-filter-argument/m-p/2658621#M78732</link>
    <description>&lt;P&gt;Okay, that make sense now.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2022 09:20:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-07-25T09:20:27Z</dc:date>
    <item>
      <title>Error in Calculate filter argument</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-Calculate-filter-argument/m-p/2654043#M78335</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Today I have encountered strange issue that I can't understand.&lt;/P&gt;&lt;P&gt;I have an AAS model where I created a measure:&lt;/P&gt;&lt;P&gt;CALCULATE('Measures Table'[Spend],SELECTEDVALUE(Company[txt_country])='Supplier Country'[txt_country])&lt;/P&gt;&lt;P&gt;and it is working fine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I switched the model to SSAS where the model and the underlying dataset is exactly the same as in this AAS&lt;/P&gt;&lt;P&gt;Everything in this SSAS model is working the same as in AAS, except that measure which is throwing a error that "SELECTEDVALUE has been used in a True/False expression..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found out that when I apply this measure with FILTER function it is working fine:&lt;/P&gt;&lt;P&gt;CALCULATE('Measures Table'[Spend],FILTER('Supplier Country',SELECTEDVALUE(Company[txt_country])='Supplier Country'[txt_country]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Any reason why is that differs between those, basically the same, 2 models?&lt;/P&gt;&lt;P&gt;2. I always thought that the second argument in CALCULATE function is the exact equvalent of FILTER function, so why do I need to actually put FILTER function so it could work here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 18:29:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-Calculate-filter-argument/m-p/2654043#M78335</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-21T18:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Calculate filter argument</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-Calculate-filter-argument/m-p/2654361#M78363</link>
      <description>&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dax/calculate-function-dax" target="_blank"&gt;https://docs.microsoft.com/en-us/dax/calculate-function-dax&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A Boolean expression filter is an expression that evaluates to TRUE or FALSE. There are several rules that they must abide by:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;They can reference columns from a single table.&lt;/LI&gt;&lt;LI&gt;They cannot reference measures.&lt;/LI&gt;&lt;LI&gt;They cannot use a nested CALCULATE function.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Beginning with the September 2021 release of Power BI Desktop, the following also apply:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;They cannot use functions that scan or return a table unless they are passed as arguments to aggregation functions.&lt;/LI&gt;&lt;LI&gt;They&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;can&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;contain an aggregation function that returns a scalar value. For example,&lt;DIV class=""&gt;&lt;SPAN class=""&gt;DAX&lt;/SPAN&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Total sales on the last selected &lt;SPAN class=""&gt;date&lt;/SPAN&gt; =
&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt; (
    &lt;SPAN class=""&gt;SUM&lt;/SPAN&gt; ( Sales[Sales Amount] ),
    'Sales'[OrderDateKey] = &lt;SPAN class=""&gt;MAX&lt;/SPAN&gt; ( 'Sales'[OrderDateKey] )
)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That means&lt;/P&gt;&lt;P&gt;CALCULATE('Measures Table'[Spend],SELECTEDVALUE(Company[txt_country])='Supplier Country'[txt_country])&lt;/P&gt;&lt;P&gt;works fine because of the update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SSAS&amp;nbsp;have not get the update yet.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 22:36:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-Calculate-filter-argument/m-p/2654361#M78363</guid>
      <dc:creator>vapid128</dc:creator>
      <dc:date>2022-07-21T22:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Calculate filter argument</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-Calculate-filter-argument/m-p/2658621#M78732</link>
      <description>&lt;P&gt;Okay, that make sense now.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 09:20:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-Calculate-filter-argument/m-p/2658621#M78732</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-25T09:20:27Z</dc:date>
    </item>
  </channel>
</rss>

