<?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: filter visually but not the underlying calculation? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/filter-visually-but-not-the-underlying-calculation/m-p/2562244#M72925</link>
    <description>&lt;P&gt;Thanks &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a date table and i am getting the data i want if i display all 30 years of history. The problem is how to display only 6 months but keep the full total in a way i can still filter/slicer by department.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I filter the visual to display only the last 6 months it only shows the total for people who started in the last six months. If i add an ALL clause it displays the correct total when filtered to show the last 6 months but i lose the ability to filter/slicer by department.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had some help on another thread here is my measure:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Employee Count = 
VAR CurrentDate = MAX ( Dim_Calendar[Date] )
VAR SelectedData = ALLSELECTED ( FACT_Data )
VAR EmpData = FILTER ( SelectedData, FACT_Data[Start/Finish] = "Employment Date" )
VAR TerData = FILTER ( SelectedData, FACT_Data[Start/Finish] = "Termination Date" )
VAR Employed = COUNTROWS ( FILTER ( EmpData, FACT_Data[ Date ] &amp;lt;= CurrentDate ) )
VAR Terminated = COUNTROWS ( FILTER ( TerData, FACT_Data[ Date ] &amp;lt;= CurrentDate ) )
RETURN
    Employed - Terminated&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jun 2022 23:42:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-06-06T23:42:21Z</dc:date>
    <item>
      <title>filter visually but not the underlying calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/filter-visually-but-not-the-underlying-calculation/m-p/2560178#M72804</link>
      <description>&lt;P&gt;i have a running total headcount that goes back many years.&amp;nbsp; Total is: new starts - exits = current count.&amp;nbsp; &amp;nbsp;this calculation works and displays fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to display only the last 12 months totals - the problem is when i filter the visual to only show last 6 months it ignores all the starts and exits before that date - to fix this i changed the formula to include the ALL filter and it works.&amp;nbsp; except i also need to be able to filter by department which i can no longer do thanks to the ALL filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a way to only display the last 12 months of a visual without impacting the calculation/still allowing a catagory filter?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 05:49:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/filter-visually-but-not-the-underlying-calculation/m-p/2560178#M72804</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-06T05:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: filter visually but not the underlying calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/filter-visually-but-not-the-underlying-calculation/m-p/2560730#M72837</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , if there is no date filter. using a date table &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;use today if needed&lt;/P&gt;
&lt;P&gt;Rolling 12 Sales = &lt;BR /&gt;var _max = maxx(allselcted(date),date[date]) // or today() &lt;BR /&gt;var _min = date(year(_max), month(_max)-12,1)&lt;BR /&gt;return &lt;BR /&gt;CALCULATE(SUM(Sales[Sales Amount]),filter(date, date[date] &amp;lt;=_max &amp;amp;&amp;amp; date[date] &amp;gt;=_min))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you have a date selected and you want to show trend , then you need an independent date table&lt;/P&gt;
&lt;P&gt;//Date1 is independent Date table, Date is joined with Table &lt;BR /&gt;new measure =&lt;BR /&gt;var _max = maxx(allselected(Date1),Date1[Date])&lt;BR /&gt;var _min = eomonth(_max, -12) +1 &lt;BR /&gt;return &lt;BR /&gt;calculate( sum(Table[Value]), filter('Date', 'Date'[Date] &amp;gt;=_min &amp;amp;&amp;amp; 'Date'[Date] &amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need of an Independent Date Table:&lt;A href="https://www.youtube.com/watch?v=44fGGmg9fHI" target="_blank"&gt;https://www.youtube.com/watch?v=44fGGmg9fHI&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 09:22:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/filter-visually-but-not-the-underlying-calculation/m-p/2560730#M72837</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-06-06T09:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: filter visually but not the underlying calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/filter-visually-but-not-the-underlying-calculation/m-p/2562244#M72925</link>
      <description>&lt;P&gt;Thanks &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a date table and i am getting the data i want if i display all 30 years of history. The problem is how to display only 6 months but keep the full total in a way i can still filter/slicer by department.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I filter the visual to display only the last 6 months it only shows the total for people who started in the last six months. If i add an ALL clause it displays the correct total when filtered to show the last 6 months but i lose the ability to filter/slicer by department.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had some help on another thread here is my measure:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Employee Count = 
VAR CurrentDate = MAX ( Dim_Calendar[Date] )
VAR SelectedData = ALLSELECTED ( FACT_Data )
VAR EmpData = FILTER ( SelectedData, FACT_Data[Start/Finish] = "Employment Date" )
VAR TerData = FILTER ( SelectedData, FACT_Data[Start/Finish] = "Termination Date" )
VAR Employed = COUNTROWS ( FILTER ( EmpData, FACT_Data[ Date ] &amp;lt;= CurrentDate ) )
VAR Terminated = COUNTROWS ( FILTER ( TerData, FACT_Data[ Date ] &amp;lt;= CurrentDate ) )
RETURN
    Employed - Terminated&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 23:42:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/filter-visually-but-not-the-underlying-calculation/m-p/2562244#M72925</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-06T23:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: filter visually but not the underlying calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/filter-visually-but-not-the-underlying-calculation/m-p/2565394#M73081</link>
      <description>&lt;P&gt;Not as eloquent of a solution as i had hoped but using zoom sliders achieved what i was after.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 03:23:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/filter-visually-but-not-the-underlying-calculation/m-p/2565394#M73081</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-08T03:23:15Z</dc:date>
    </item>
  </channel>
</rss>

