<?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: Slicer affecting measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3443139#M130847</link>
    <description>&lt;P&gt;Hey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That did work, thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when Apply the slicer to select the relevant period it seems to filter the measure.&lt;BR /&gt;&lt;BR /&gt;The period slicer relates to about 20 dates, so I want to take the max of those days for the end date in the dates between. But I think what it is doing is over-riding the start date?&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2023 13:18:22 GMT</pubDate>
    <dc:creator>EWBWEBB</dc:creator>
    <dc:date>2023-09-22T13:18:22Z</dc:date>
    <item>
      <title>Slicer affecting measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3442925#M130834</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to count the total number of people that joined the business in the last two years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to use a slicer to select the current reporting period and then return all the new joiners from the 1st of January from 2 years before the last date of the selected period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So selecting any period that ends in 2023 would return all the joiners since 01/01/2021, a period ending in 2024 will return all joiners since 01/01/2022 and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TotalNotMaleJoiners (Heads) L2Y = 
    CALCULATE(
        [TotalJoiners (Heads)]
        ,FILTER(
            'PersonDim',
            'PersonDim'[Gender] &amp;lt;&amp;gt; "Male"
        )
        ,FILTER(
            'DateDim',
            'DateDim'[FullDate] IN

            VAR SelectedYear = 
            YEAR(
                MAXX(
                    ALL('DateDim'),
                    SELECTEDVALUE('DateDim'[FullDate], TODAY()
                    )
                )
            )

            VAR Jan1TwoYearsAgo = 
            DATE(SelectedYear - 2,1,1)

            VAR PeriodMaxDate =             
            MAXX(
                ALL('DateDim'),
                SELECTEDVALUE('DateDim'[FullDate], TODAY()
                )
            )

            RETURN
            DATESBETWEEN('DateDim'[FullDate],Jan1TwoYearsAgo,PeriodMaxDate)
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use a slicer to select a period it is overwriding all the date min/max, I'm assuming I need to wrap something with an ALL/ALLSELECTED but I've tried it all over the place and whatever I do the slicer seems to affect the measure.&lt;BR /&gt;&lt;BR /&gt;Any help greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My slicer is from a column in the DateDim table but is a text value so I can't just use MAX or MAXX on that.&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>Fri, 22 Sep 2023 11:30:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3442925#M130834</guid>
      <dc:creator>EWBWEBB</dc:creator>
      <dc:date>2023-09-22T11:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer affecting measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3442980#M130836</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="294792" data-lia-user-login="EWBWEBB" class="lia-mention lia-mention-user"&gt;EWBWEBB&lt;/a&gt;&amp;nbsp;, Breaking the interactions of the slicer with the visuals that contain the measure can help the case.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 12:06:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3442980#M130836</guid>
      <dc:creator>ChiragGarg2512</dc:creator>
      <dc:date>2023-09-22T12:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer affecting measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3442989#M130837</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="615042" data-lia-user-login="ChiragGarg2512" class="lia-mention lia-mention-user"&gt;ChiragGarg2512&lt;/a&gt;&amp;nbsp;- thanks for the suggestion.&lt;BR /&gt;&lt;BR /&gt;Just gave it a go and if I do that the value in the visual doesn't change at all?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems to be all or nothing?&lt;BR /&gt;&lt;BR /&gt;I think what I want to do is wrap the DATESBETWEEN DateDim[FullDate] within an ALL but it doesn't like that.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 12:12:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3442989#M130837</guid>
      <dc:creator>EWBWEBB</dc:creator>
      <dc:date>2023-09-22T12:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer affecting measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3443122#M130846</link>
      <description>&lt;P&gt;I think&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; VAR SelectedYear = 
 YEAR(  MAX(  'DateDim'[Fulldate] ) )&lt;/LI-CODE&gt;&lt;P&gt;should work just fine to start with.&amp;nbsp;&lt;BR /&gt;By using the all function for your date table you remove it's filters, but that's not what you want in this case?&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 13:10:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3443122#M130846</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-22T13:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer affecting measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3443139#M130847</link>
      <description>&lt;P&gt;Hey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That did work, thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when Apply the slicer to select the relevant period it seems to filter the measure.&lt;BR /&gt;&lt;BR /&gt;The period slicer relates to about 20 dates, so I want to take the max of those days for the end date in the dates between. But I think what it is doing is over-riding the start date?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 13:18:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3443139#M130847</guid>
      <dc:creator>EWBWEBB</dc:creator>
      <dc:date>2023-09-22T13:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer affecting measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3443156#M130849</link>
      <description>&lt;P&gt;Hi All&lt;BR /&gt;&lt;BR /&gt;Took a different approach and got the desired result - also alot simpler.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TotalNotMaleJoiners (Heads) L2Y = 
VAR MaxDate = 
MAX('DateDim'[FullDate])

VAR CurrentYear =
   YEAR(
    MAX('DateDim'[FullDate])
   )

VAR Jan12YearsPrior = DATE(CurrentYear - 2,1,1)
    

VAR Joiners = 
CALCULATE(
    [TotalNotMaleJoiners (Heads)],
    FILTER(
        ALL('DateDim'), 'DateDim'[FullDate] &amp;gt;= Jan12YearsPrior &amp;amp;&amp;amp;
         'DateDim'[FullDate] &amp;lt;= MaxDate)
)

RETURN
Joiners&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 13:26:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3443156#M130849</guid>
      <dc:creator>EWBWEBB</dc:creator>
      <dc:date>2023-09-22T13:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer affecting measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3443210#M130853</link>
      <description>&lt;P&gt;something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TotalNotMaleJoiners (Heads) L2Y = 
    VAR PeriodMaxDate = MAX('DateDim'[FullDate])
    VAR Jan1TwoYearsAgo = DATE(YEAR(PeriodMaxDate)  - 2,1,1)
    VAR  VAR DateRange = CALCULATE(DATESBETWEEN('DateDim'[FullDate],Jan1TwoYearsAgo,PeriodMaxDate), ALL('DateDim'))
    RETRN CALCULATE(
        [TotalJoiners (Heads)]
        ,'PersonDim'[Gender] &amp;lt;&amp;gt; "Male"
        ,ALL('DateDim')
        ,'DateDim'[FullDate] IN DateRange
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Sep 2023 13:50:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-affecting-measure/m-p/3443210#M130853</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-22T13:50:28Z</dc:date>
    </item>
  </channel>
</rss>

