<?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: Rankx with ALLSELECT +ALLEXCEPT in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454611#M131663</link>
    <description>&lt;P&gt;Thanks for the lengthy expalantion.&lt;BR /&gt;But the issue is in DAX 01 result respect the external filter context :e:g calender month.&lt;/P&gt;</description>
    <pubDate>Sat, 30 Sep 2023 15:38:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-09-30T15:38:45Z</dc:date>
    <item>
      <title>Rankx with ALLSELECT +ALLEXCEPT</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3453315#M131586</link>
      <description>&lt;DIV class=""&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;I am trying to differentiated the below two dax snippets based on the outer filter context.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;DAX 01&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;RANKX (&lt;BR /&gt;ALLSELECTED ( CUSTOMERS[CUSTOMER_PARENT_ID] ),&lt;BR /&gt;CALCULATE (&lt;BR /&gt;[Total AR Amount],&lt;BR /&gt;ALLEXCEPT ( CUSTOMERS, CUSTOMERS[CUSTOMER_PARENT_ID] )&lt;BR /&gt;),&lt;BR /&gt;,&lt;BR /&gt;DESC,&lt;BR /&gt;DENSE&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;With this DAX if i have an external slicer let’s say calender month,if i select last month i got the last month total AR amount ,but i have used allexcept at the beginning ,still i got the last month value.how that happen?&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;DAX 02&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;RANKX (&lt;BR /&gt;ALLSELECTED ( CUSTOMERS[CUSTOMER_PARENT_ID] ),&lt;BR /&gt;[Total AR Amount],&lt;BR /&gt;,&lt;BR /&gt;DESC,&lt;BR /&gt;DENSE&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;What would be the difference in this with respect to above DAX 01 and if have an external slicer like calender month.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Sep 2023 13:21:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3453315#M131586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-29T13:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with ALLSELECT +ALLEXCEPT</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454442#M131645</link>
      <description>&lt;P&gt;&lt;SPAN&gt;In Power BI, the behavior of DAX measures can sometimes be a bit complex due to the interaction between filter contexts. Let's break down the two DAX snippets you provided and explain the differences in their behavior:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;DAX 01:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;RANKX ( ALLSELECTED ( CUSTOMERS[CUSTOMER_PARENT_ID] ), CALCULATE ( [Total AR Amount], ALLEXCEPT ( CUSTOMERS, CUSTOMERS[CUSTOMER_PARENT_ID] ) ), , DESC, DENSE )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DAX 02:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;RANKX (&lt;BR /&gt;ALLSELECTED ( CUSTOMERS[CUSTOMER_PARENT_ID] ),&lt;BR /&gt;[Total AR Amount],&lt;BR /&gt;,&lt;BR /&gt;DESC,&lt;BR /&gt;DENSE&lt;BR /&gt;)&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In both cases, you are using the RANKX function to rank customers based on their [Total AR Amount], considering the filter context applied to CUSTOMERS[CUSTOMER_PARENT_ID].&lt;/P&gt;&lt;P&gt;Now, let's discuss the differences:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;DAX 01:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Uses the ALLEXCEPT function to remove filters from all columns in the CUSTOMERS table except CUSTOMERS[CUSTOMER_PARENT_ID].&lt;/LI&gt;&lt;LI&gt;This means that if you have an external slicer, like Calendar Month, selecting a particular month will not affect the filter on CUSTOMERS[CUSTOMER_PARENT_ID], so the ranking is based only on the parent customers regardless of the selected month.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;DAX 02:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Does not use the ALLEXCEPT function, which means it considers all filters applied to the entire table CUSTOMERS, including any slicers.&lt;/LI&gt;&lt;LI&gt;If you have an external slicer, like Calendar Month, selecting a specific month will filter both CUSTOMERS[CUSTOMER_PARENT_ID] and [Total AR Amount], affecting the ranking calculation. In other words, the ranking will consider the selected month's filter context.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So, the key difference is in how the filter context is applied to the CUSTOMERS[CUSTOMER_PARENT_ID] column:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;DAX 01 explicitly removes filters on all columns except CUSTOMERS[CUSTOMER_PARENT_ID] before calculating [Total AR Amount]. Thus, it ignores the Calendar Month slicer.&lt;/LI&gt;&lt;LI&gt;DAX 02 considers all filters, including the Calendar Month slicer, when calculating [Total AR Amount].&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The choice between these two DAX expressions depends on your specific requirements and how you want the ranking to respond to slicers and filter contexts. Use DAX 01 when you want to rank based on the parent customers without considering other filters, and use DAX 02 when you want to rank based on the current filter context, including slicers like Calendar Month.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 06:51:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454442#M131645</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-09-30T06:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with ALLSELECT +ALLEXCEPT</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454611#M131663</link>
      <description>&lt;P&gt;Thanks for the lengthy expalantion.&lt;BR /&gt;But the issue is in DAX 01 result respect the external filter context :e:g calender month.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 15:38:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454611#M131663</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-30T15:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with ALLSELECT +ALLEXCEPT</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454672#M131666</link>
      <description>&lt;P&gt;Pleae try this:&lt;/P&gt;&lt;P&gt;RANKX (&lt;BR /&gt;ALLSELECTED ( CUSTOMERS[CUSTOMER_PARENT_ID] ),&lt;BR /&gt;CALCULATE (&lt;BR /&gt;[Total AR Amount],&lt;BR /&gt;ALLEXCEPT ( CUSTOMERS, CUSTOMERS[CUSTOMER_PARENT_ID] )&lt;BR /&gt;),&lt;BR /&gt;,&lt;BR /&gt;DESC,&lt;BR /&gt;DENSE&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;The behavior of DAX 01 with respect to the external slicer (calendar month) is as follows:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;ALLSELECTED(CUSTOMERS[CUSTOMER_PARENT_ID]) removes filters on the CUSTOMERS[CUSTOMER_PARENT_ID] column but retains filters from other slicers, including the calendar month slicer.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;CALCULATE([Total AR Amount], ALLEXCEPT(CUSTOMERS, CUSTOMERS[CUSTOMER_PARENT_ID])) calculates the [Total AR Amount] within the filter context specified by ALLEXCEPT. However, it only preserves the filter context for CUSTOMERS[CUSTOMER_PARENT_ID], not for other columns like calendar month.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;So, if you select a calendar month using an external slicer, DAX 01 will still consider the filter on CUSTOMERS[CUSTOMER_PARENT_ID] but not the filter on the calendar month. This means that the rank will be based on the filtered [Total AR Amount] within the selected CUSTOMERS[CUSTOMER_PARENT_ID] group, regardless of the calendar month slicer's selection.&lt;/P&gt;&lt;P&gt;If you are observing different behavior, it may be due to other factors or interactions within your Power BI or Analysis Services model. DAX evaluation can be influenced by various factors such as relationships between tables, slicer interactions, and measures in your model. Please make sure that there are no additional filters or measures affecting the result or share more details about your model for a more specific analysis.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 30 Sep 2023 18:14:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454672#M131666</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-09-30T18:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with ALLSELECT +ALLEXCEPT</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454673#M131667</link>
      <description>&lt;P&gt;hi,&amp;nbsp;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;use&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RANKX (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ALLSELECTED ( CUSTOMERS[CUSTOMER_PARENT_ID] ),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[Total AR Amount],&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;all(&lt;SPAN&gt;CUSTOMERS&lt;/SPAN&gt;),values(&lt;SPAN&gt;CUSTOMERS[CUSTOMER_PARENT_ID])&amp;nbsp; ----- (here all remove &lt;STRONG&gt;all filter context&lt;/STRONG&gt; from &lt;STRONG&gt;expanded table&lt;/STRONG&gt; but values &lt;STRONG&gt;restore&amp;nbsp;filter context of CUSTOMERS[CUSTOMER_PARENT_ID]&lt;/STRONG&gt;&amp;nbsp;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DESC,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DENSE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 18:22:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454673#M131667</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-09-30T18:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with ALLSELECT +ALLEXCEPT</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454681#M131668</link>
      <description>&lt;P&gt;hi,&amp;nbsp;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RANKX (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ALLSELECTED ( CUSTOMERS[CUSTOMER_PARENT_ID] ),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[Total AR Amount],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ALLEXCEPT ( CUSTOMERS, CUSTOMERS[CUSTOMER_PARENT_ID] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DESC,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DENSE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;here you use allexcept as &lt;STRONG&gt;calculatemodifier&lt;/STRONG&gt; so it remove only &lt;STRONG&gt;filter context&lt;/STRONG&gt; not &lt;STRONG&gt;ignoring outer filter valu&lt;/STRONG&gt;e&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for ignoring outer filter value you will have to use it in &lt;STRONG&gt;table function&lt;/STRONG&gt; not in &lt;STRONG&gt;calculate modifie&lt;/STRONG&gt;r.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 18:34:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-ALLSELECT-ALLEXCEPT/m-p/3454681#M131668</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-09-30T18:34:06Z</dc:date>
    </item>
  </channel>
</rss>

