<?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: Calculated measure with two filters - 'Placeholder' error in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-measure-with-two-filters-Placeholder-error/m-p/3787528#M147961</link>
    <description>&lt;P&gt;You need to materialize the measure before using it in a comparison.&amp;nbsp; For example by assigning a variable to the measure value, or by using SUMMARIZE/SUMMARIZECOLUMNS.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Mar 2024 15:06:11 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-03-23T15:06:11Z</dc:date>
    <item>
      <title>Calculated measure with two filters - 'Placeholder' error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-measure-with-two-filters-Placeholder-error/m-p/3787441#M147945</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I want to calculate our current on hand units based on a filter that looks at the current week and where gross units are &amp;gt;=1.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This first query works: 1 filter&lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Current OH Units =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;POS_Data&lt;/SPAN&gt;&lt;SPAN&gt;[ON_HAND_UNITS]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;POS_Data&lt;/SPAN&gt;&lt;SPAN&gt;[Current Week1]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When attempting to create the below second filter i recieve this error:&amp;nbsp;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;Error: A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression.&amp;nbsp; This is not allowed.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Current OH Units1 = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(POS_Data[ON_HAND_UNITS]),POS_Data,POS_Data[Current Week1]=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,[Gross Sales Units]&amp;gt;=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm assuming this is in reference to measure Gross Sales Unit which is written as:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Gross Sales Units =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;POS_Data&lt;/SPAN&gt;&lt;SPAN&gt;[SALES_UNITS_BEFORE_RETURNS]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My display columns are: Customer Name, Item, Store Number, Current OH Units.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The intent is to only look at stores who's already had sales of 1 unit or more which is why the last filter was trying to be placed.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you in advance.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 23 Mar 2024 11:20:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-measure-with-two-filters-Placeholder-error/m-p/3787441#M147945</guid>
      <dc:creator>FischerEric86</dc:creator>
      <dc:date>2024-03-23T11:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated measure with two filters - 'Placeholder' error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-measure-with-two-filters-Placeholder-error/m-p/3787528#M147961</link>
      <description>&lt;P&gt;You need to materialize the measure before using it in a comparison.&amp;nbsp; For example by assigning a variable to the measure value, or by using SUMMARIZE/SUMMARIZECOLUMNS.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2024 15:06:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-measure-with-two-filters-Placeholder-error/m-p/3787528#M147961</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-23T15:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated measure with two filters - 'Placeholder' error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-measure-with-two-filters-Placeholder-error/m-p/3803749#M148731</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398279" data-lia-user-login="FischerEric86" class="lia-mention lia-mention-user"&gt;FischerEric86&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of PLACEHOLDER, the right name to use should be CALCULATE. Indeed, every time there is a measure reference, it could be replaced by CALCULATE ( &amp;lt;measure definition&amp;gt; ). However, the error message leaves the generic PLACEHOLDER name instead of mentioning CALCULATE. So the issue is: the presence of a context transition in a predicate filter argument. Thus, the solution is that we should evaluate the measure reference and assign the result to a variable before CALCULATE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This link can help:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/solving-errors-in-calculate-filter-arguments/#:~:text=%E5%87%BD%E6%95%B0%E2%80%9CPLACEHOLDER%E2%80%9D%E5%B7%B2%E5%9C%A8%E7%94%A8%E4%BD%9C%E8%A1%A8%E7%AD%9B%E9%80%89%E5%99%A8%E8%A1%A8%E8%BE%BE%E5%BC%8F%E7%9A%84%20True/False%20%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%B8%AD%E4%BD%BF%E7%94%A8%E3%80%82%E8%BF%99%E6%98%AF%E4%B8%8D%E5%85%81%E8%AE%B8%E7%9A%84%E3%80%82" target="_self"&gt;solving-errors-in-calculate-filter-arguments&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 05:49:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-measure-with-two-filters-Placeholder-error/m-p/3803749#M148731</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-02T05:49:35Z</dc:date>
    </item>
  </channel>
</rss>

