<?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 How do I use a filtered table to filter it's not filtered self in a FILTER() function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-use-a-filtered-table-to-filter-it-s-not-filtered-self/m-p/3166227#M113886</link>
    <description>&lt;P&gt;This measure calculates the actual fiscal year sales up to the current month.&lt;BR /&gt;As you can see&amp;nbsp;'CALENDAR'[FiscalYearOrder] is the field that contains the fiscal year, so I make sure that it is equal to the MAX fiscal year, wich will be the current year.&lt;BR /&gt;Then I make sure that&amp;nbsp;'CALENDAR'[FiscalMonthOrder] wich is the fiscal month in order from 1 to 12,&amp;nbsp; is less or equal to the actual month's fiscal month order.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE(
    SUM('FORECASTxSALES'[SALES]),
    FILTER(
        ALL('CALENDAR'),
        ( 
            ('CALENDAR'[FiscalYearOrder] = MAX('CALENDAR'[FiscalYearOrder])) &amp;amp;&amp;amp;
            ( VALUE('CALENDAR'[FiscalMonthOrder]) &amp;lt;= (IF(VALUE(MONTH(TODAY()))&amp;gt;=9,VALUE(MONTH(TODAY()))-8,VALUE(MONTH(TODAY()))+4)))
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to modify this measure so that it takes the maximun FiscalMonthOrder of the &lt;STRONG&gt;filtered&lt;/STRONG&gt; CALENDAR table instead the&amp;nbsp;actual month's fiscal month order. The problem is that in this measure I have already used ALL() to remove the filters of the CALENDAR table.&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;CALCULATE(
    SUM('FORECASTxSALES'[SALES]),
    FILTER(
        ALL('CALENDAR'),
        ( 
            ('CALENDAR'[FiscalYearOrder] = MAX('CALENDAR'[FiscalYearOrder])) &amp;amp;&amp;amp;
            ( VALUE('CALENDAR'[FiscalMonthOrder]) &amp;lt;= MAX('CALENDAR'[FiscalMonthOrder]))
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The previous example would return the maximun&amp;nbsp;FiscalMonthOrder of the calendar table, but if the user has filtered the&amp;nbsp;FiscalMonthOrder it wouldn't impact the masure, and I want it to impact.&lt;BR /&gt;I want the measure to return the actual fiscal year sales up to the&lt;STRONG&gt; maximun month selected by the user&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2023 15:19:33 GMT</pubDate>
    <dc:creator>BEchagueSNTX</dc:creator>
    <dc:date>2023-03-31T15:19:33Z</dc:date>
    <item>
      <title>How do I use a filtered table to filter it's not filtered self in a FILTER() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-use-a-filtered-table-to-filter-it-s-not-filtered-self/m-p/3166227#M113886</link>
      <description>&lt;P&gt;This measure calculates the actual fiscal year sales up to the current month.&lt;BR /&gt;As you can see&amp;nbsp;'CALENDAR'[FiscalYearOrder] is the field that contains the fiscal year, so I make sure that it is equal to the MAX fiscal year, wich will be the current year.&lt;BR /&gt;Then I make sure that&amp;nbsp;'CALENDAR'[FiscalMonthOrder] wich is the fiscal month in order from 1 to 12,&amp;nbsp; is less or equal to the actual month's fiscal month order.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE(
    SUM('FORECASTxSALES'[SALES]),
    FILTER(
        ALL('CALENDAR'),
        ( 
            ('CALENDAR'[FiscalYearOrder] = MAX('CALENDAR'[FiscalYearOrder])) &amp;amp;&amp;amp;
            ( VALUE('CALENDAR'[FiscalMonthOrder]) &amp;lt;= (IF(VALUE(MONTH(TODAY()))&amp;gt;=9,VALUE(MONTH(TODAY()))-8,VALUE(MONTH(TODAY()))+4)))
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to modify this measure so that it takes the maximun FiscalMonthOrder of the &lt;STRONG&gt;filtered&lt;/STRONG&gt; CALENDAR table instead the&amp;nbsp;actual month's fiscal month order. The problem is that in this measure I have already used ALL() to remove the filters of the CALENDAR table.&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;CALCULATE(
    SUM('FORECASTxSALES'[SALES]),
    FILTER(
        ALL('CALENDAR'),
        ( 
            ('CALENDAR'[FiscalYearOrder] = MAX('CALENDAR'[FiscalYearOrder])) &amp;amp;&amp;amp;
            ( VALUE('CALENDAR'[FiscalMonthOrder]) &amp;lt;= MAX('CALENDAR'[FiscalMonthOrder]))
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The previous example would return the maximun&amp;nbsp;FiscalMonthOrder of the calendar table, but if the user has filtered the&amp;nbsp;FiscalMonthOrder it wouldn't impact the masure, and I want it to impact.&lt;BR /&gt;I want the measure to return the actual fiscal year sales up to the&lt;STRONG&gt; maximun month selected by the user&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 15:19:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-use-a-filtered-table-to-filter-it-s-not-filtered-self/m-p/3166227#M113886</guid>
      <dc:creator>BEchagueSNTX</dc:creator>
      <dc:date>2023-03-31T15:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a filtered table to filter it's not filtered self in a FILTER() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-use-a-filtered-table-to-filter-it-s-not-filtered-self/m-p/3168016#M114090</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming FiscalMonthOrder is the field the user is selecting in a slicer, I've modified your measure to the below. I created a variable to hold the selected month if the report viewer has picked one and the maximum FiscalMonthOrder (like you originally had) if the report viewer has not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if this works for you or if you were looking for something different. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&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;VAR SelectedMonth =
IF (
    HASONEVALUE ( 'CALENDAR'[FiscalMonthOrder] ),
    SELECTEDVALUE ( 'CALENDAR'[FiscalMonthOrder] ),
    MAX ( 'CALENDAR'[FiscalMonthOrder] )
)

RETURN
CALCULATE (
    SUM ( 'FORECASTxSALES'[SALES] ),
    FILTER (
        ALL ( 'CALENDAR' ),
        ( 
            ( 'CALENDAR'[FiscalYearOrder] = MAX ( 'CALENDAR'[FiscalYearOrder] ) ) &amp;amp;&amp;amp;
            ( VALUE ( 'CALENDAR'[FiscalMonthOrder] ) &amp;lt;= SelectedMonth )
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2023 20:54:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-use-a-filtered-table-to-filter-it-s-not-filtered-self/m-p/3168016#M114090</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2023-04-02T20:54:37Z</dc:date>
    </item>
  </channel>
</rss>

