<?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: Regarding using VALUES as a filter argument in CALCULATE in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-using-VALUES-as-a-filter-argument-in-CALCULATE/m-p/3305505#M123448</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the explaination. However, my question is more like how to explain why can only use VALUES('Date'[Year]) as a filter argument unless it's a modifier like ALL. Normal predicate(filter argument) are like,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'Product'[Color] = "Red" or
'Date'[Year] = 2008&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why I said using the code of&amp;nbsp;&lt;FONT color="#3366FF"&gt;'Date'[Year] IN VALUES('Date'[Year])&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;makes more sense for me. Can you get my point of view? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jun 2023 04:19:22 GMT</pubDate>
    <dc:creator>HungFan</dc:creator>
    <dc:date>2023-06-28T04:19:22Z</dc:date>
    <item>
      <title>Regarding using VALUES as a filter argument in CALCULATE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-using-VALUES-as-a-filter-argument-in-CALCULATE/m-p/3305426#M123445</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;I had learned that writing a measure of AllSalesCurrentYear, especially when computing a percentage over the grand total of only the current year, shall use VALUES('Date'[Year]) as a filter argument in CALCULATE. The V1 code as follows,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AllSalesCurrentYear V1 = 
CALCULATE(
        [Sales Amount],
        ALL('Sales'),
        VALUES('Date'[Year])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that VALUES only return the list of values of a column in the current filter context. But for me, it seems a bit weird to only use VALUES('Date'[Year]) as a filter argument. The reason is that the output of VALUES('Date'[Year]) is a unique list like the photo below,&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I thought the code shall change to &lt;FONT color="#3366FF"&gt;'Date'[Year] IN VALUES('Date'[Year])&lt;/FONT&gt; that makes more sense for me. And then after trying the code, I found those result are the same. The V2 code is as follows,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AllSalesCurrentYear V2 =
CALCULATE(
        [Sales Amount],
        ALL('Sales'),
        'Date'[Year] IN VALUES('Date'[Year])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The matrix is as follows,&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Does anyone has a better understanding of the V1 code? How to explain for people that can only use VALUES('Date'[Year]) as a filter argument for this case.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 02:54:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-using-VALUES-as-a-filter-argument-in-CALCULATE/m-p/3305426#M123445</guid>
      <dc:creator>HungFan</dc:creator>
      <dc:date>2023-06-28T02:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding using VALUES as a filter argument in CALCULATE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-using-VALUES-as-a-filter-argument-in-CALCULATE/m-p/3305443#M123447</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;In my opinion, in DAX Studio, it shows all years because there is no filter context.&lt;/P&gt;
&lt;P&gt;In the table visualization, there is a filter context in each column, and in the 2007 column, for instance, VALUES ('Date[Year] ) = 2007.&lt;/P&gt;
&lt;P&gt;I hope this explains.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 03:08:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-using-VALUES-as-a-filter-argument-in-CALCULATE/m-p/3305443#M123447</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-06-28T03:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding using VALUES as a filter argument in CALCULATE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-using-VALUES-as-a-filter-argument-in-CALCULATE/m-p/3305505#M123448</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the explaination. However, my question is more like how to explain why can only use VALUES('Date'[Year]) as a filter argument unless it's a modifier like ALL. Normal predicate(filter argument) are like,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'Product'[Color] = "Red" or
'Date'[Year] = 2008&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why I said using the code of&amp;nbsp;&lt;FONT color="#3366FF"&gt;'Date'[Year] IN VALUES('Date'[Year])&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;makes more sense for me. Can you get my point of view? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 04:19:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-using-VALUES-as-a-filter-argument-in-CALCULATE/m-p/3305505#M123448</guid>
      <dc:creator>HungFan</dc:creator>
      <dc:date>2023-06-28T04:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding using VALUES as a filter argument in CALCULATE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-using-VALUES-as-a-filter-argument-in-CALCULATE/m-p/3305523#M123449</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;A href="https://dax.guide/values/" target="_blank" rel="noopener"&gt;VALUES - DAX Guide&lt;/A&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;VALUES() returns a table, which functions as filter in the calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;A href="https://dax.guide/op/in/" target="_blank" rel="noopener"&gt;IN - DAX Guide&lt;/A&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;'Date'[Year] &lt;STRONG&gt;IN&lt;/STRONG&gt; VALUES('Date'[Year]) is&amp;nbsp;syntactic sugar for the &lt;STRONG&gt;CONTAINSROW&lt;/STRONG&gt;(), it's interchangeable with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CONTAINSROW (
    VALUES('Date'[Year]),
    'Date'[Year]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in your case, an alternative to V1 is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= CALCULATE( [Sales Amount], ALLEXCEPT( 'Sales', 'Date'[Year] ) )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 04:52:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regarding-using-VALUES-as-a-filter-argument-in-CALCULATE/m-p/3305523#M123449</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2023-06-28T04:52:25Z</dc:date>
    </item>
  </channel>
</rss>

