<?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: How to filter DAX same period last year column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-DAX-same-period-last-year-column/m-p/1131889#M16822</link>
    <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, the slicers will slice visuals and show only relevant dates. It is not clear from your example if you have created a calendar table in your data model. For time intelligence function to work properly, it is recommended to have a calendar table in the data model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have recreated a sample scenario, and used following measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Orders (SPLY) = 
    CALCULATE(
       [Total Orders],
       SAMEPERIODLASTYEAR(ftCalendar[Date])
    )

Total Orders A(SPLY) = 
    CALCULATE(
       [Total Orders],
       ALL(ftCalendar[Date]),
       SAMEPERIODLASTYEAR(ftCalendar[Date])
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is the result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As you can see, both the formula is giving me the desired results and the visual is filtering accordingly.&lt;/P&gt;&lt;P&gt;In this, I have created a calendar table and used it in the model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may refer to the article for adding a calendar table:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;A href="https://www.vivran.in/post/power-bi-time-intelligence-calendar-table" target="_blank" rel="noopener"&gt;https://www.vivran.in/post/power-bi-time-intelligence-calendar-table&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Cheers!&lt;BR /&gt;Vivek&lt;BR /&gt;&lt;BR /&gt;If it helps, please mark it as a solution. Kudos would be a cherry on the top &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Feel free to &lt;A href="mailto:contact@vivran.in" target="_blank" rel="noopener"&gt;email&lt;/A&gt; me for any BI needs.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Blog: &lt;A href="https://www.vivran.in/my-blog" target="_blank" rel="noopener"&gt;vivran.in/my-blog&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/vivek-ranjan-063a1a17b/" target="_blank" rel="noopener"&gt;Connect on LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://twitter.com/imvivran" target="_blank" rel="noopener"&gt;Follow on Twitter&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jun 2020 00:42:31 GMT</pubDate>
    <dc:creator>vivran22</dc:creator>
    <dc:date>2020-06-01T00:42:31Z</dc:date>
    <item>
      <title>How to filter DAX same period last year column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-DAX-same-period-last-year-column/m-p/1121702#M16548</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this table with units and units of the previous period. To be able to filter with this slicer i added to the SPLY metric an ALL() function, because if i do not, the metric doesn't show values when i filter by one specific month as in the screencapture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;My problem now is that i need to show in the table only the values of the month-year filtered in the slicer and the total of only this specific period. Is there any dax function to combine with ALL() in order to display only the selected datetime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way i calculate Same period last year column is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Units SPLY = CALCULATE (&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; SUM ( 'Tabla'[Units Actual] );&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ALL(Tabla[Date]);&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; SAMEPERIODLASTYEAR (Tabla[Date].[Date])&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 07:55:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-DAX-same-period-last-year-column/m-p/1121702#M16548</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-27T07:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter DAX same period last year column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-DAX-same-period-last-year-column/m-p/1131889#M16822</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, the slicers will slice visuals and show only relevant dates. It is not clear from your example if you have created a calendar table in your data model. For time intelligence function to work properly, it is recommended to have a calendar table in the data model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have recreated a sample scenario, and used following measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Orders (SPLY) = 
    CALCULATE(
       [Total Orders],
       SAMEPERIODLASTYEAR(ftCalendar[Date])
    )

Total Orders A(SPLY) = 
    CALCULATE(
       [Total Orders],
       ALL(ftCalendar[Date]),
       SAMEPERIODLASTYEAR(ftCalendar[Date])
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is the result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As you can see, both the formula is giving me the desired results and the visual is filtering accordingly.&lt;/P&gt;&lt;P&gt;In this, I have created a calendar table and used it in the model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may refer to the article for adding a calendar table:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;A href="https://www.vivran.in/post/power-bi-time-intelligence-calendar-table" target="_blank" rel="noopener"&gt;https://www.vivran.in/post/power-bi-time-intelligence-calendar-table&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Cheers!&lt;BR /&gt;Vivek&lt;BR /&gt;&lt;BR /&gt;If it helps, please mark it as a solution. Kudos would be a cherry on the top &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Feel free to &lt;A href="mailto:contact@vivran.in" target="_blank" rel="noopener"&gt;email&lt;/A&gt; me for any BI needs.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Blog: &lt;A href="https://www.vivran.in/my-blog" target="_blank" rel="noopener"&gt;vivran.in/my-blog&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/vivek-ranjan-063a1a17b/" target="_blank" rel="noopener"&gt;Connect on LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://twitter.com/imvivran" target="_blank" rel="noopener"&gt;Follow on Twitter&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 00:42:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-DAX-same-period-last-year-column/m-p/1131889#M16822</guid>
      <dc:creator>vivran22</dc:creator>
      <dc:date>2020-06-01T00:42:31Z</dc:date>
    </item>
  </channel>
</rss>

