<?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: DAX Behavior in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5135929#M187433</link>
    <description>&lt;DIV class=""&gt;&lt;SPAN class=""&gt;The behavior you are experiencing is a classic example of how &lt;/SPAN&gt;&lt;STRONG&gt;row contexts&lt;/STRONG&gt;&lt;SPAN class=""&gt;, &lt;/SPAN&gt;&lt;STRONG&gt;measure references&lt;/STRONG&gt;&lt;SPAN class=""&gt;, and &lt;/SPAN&gt;&lt;STRONG&gt;context transition&lt;/STRONG&gt;&lt;SPAN class=""&gt; interact in DAX.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Here is exactly what is happening:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;The &lt;/SPAN&gt;FILTER&lt;SPAN class=""&gt; function is an &lt;/SPAN&gt;&lt;STRONG&gt;iterator&lt;/STRONG&gt;&lt;SPAN class=""&gt;. When you write &lt;/SPAN&gt;FILTER('Product Lookup', ...)&lt;SPAN class=""&gt;, DAX scans the &lt;/SPAN&gt;'Product Lookup'&lt;SPAN class=""&gt; table row by row, creating a &lt;/SPAN&gt;&lt;STRONG&gt;row context&lt;/STRONG&gt;&lt;SPAN class=""&gt; for the evaluation of the condition&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;When you place a measure reference like &lt;/SPAN&gt;[Average Retail Price]&lt;SPAN class=""&gt; inside this row context, DAX automatically wraps it in an implicit &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; function&lt;/SPAN&gt;&lt;SPAN class=""&gt;. If &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; is executed within a row context, it triggers a &lt;/SPAN&gt;&lt;STRONG&gt;context transition&lt;/STRONG&gt;&lt;SPAN class=""&gt;. This means DAX invalidates the row context and automatically creates a new &lt;/SPAN&gt;&lt;STRONG&gt;filter context&lt;/STRONG&gt;&lt;SPAN class=""&gt; that filters the model down to the currently iterated row&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;As a result, &lt;/SPAN&gt;[Average Retail Price]&lt;SPAN class=""&gt; does not compute the grand total average of all products. Instead, because of the context transition, it computes the average retail price &lt;/SPAN&gt;&lt;I&gt;only for the current product being iterated&lt;/I&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Consequently, your logical test evaluates if the product's price is strictly greater than its own price. Because there is no product whose price is greater than itself, the condition is never met, and &lt;/SPAN&gt;FILTER&lt;SPAN class=""&gt; returns an empty table&lt;/SPAN&gt;&lt;SPAN class=""&gt;. Passing an empty table into the outer &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; to compute &lt;/SPAN&gt;[Total Orders]&lt;SPAN class=""&gt; naturally yields a &lt;/SPAN&gt;BLANK&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Your &lt;/SPAN&gt;[Overall Average Price]&lt;SPAN class=""&gt; measure is explicitly defined with the &lt;/SPAN&gt;ALL('Product Lookup')&lt;SPAN class=""&gt; modifier.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;When you use &lt;/SPAN&gt;[Overall Average Price]&lt;SPAN class=""&gt; inside &lt;/SPAN&gt;FILTER&lt;SPAN class=""&gt;, the implicit &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; still triggers a context transition that attempts to filter the calculation down to the current row&lt;/SPAN&gt;&lt;SPAN class=""&gt;. However, &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; executes its operations in a very specific order: &lt;/SPAN&gt;&lt;STRONG&gt;CALCULATE modifiers (like &lt;/STRONG&gt;&lt;STRONG&gt;ALL&lt;/STRONG&gt;&lt;STRONG&gt;) are applied &lt;/STRONG&gt;&lt;STRONG&gt;after&lt;/STRONG&gt;&lt;STRONG&gt; the context transition happens&lt;/STRONG&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Because &lt;/SPAN&gt;ALL&lt;SPAN class=""&gt; is evaluated after the context transition, it acts as a filter remover and overrides the effect of the context transition&lt;/SPAN&gt;&lt;SPAN class=""&gt;. It removes the row-level filters applied to the &lt;/SPAN&gt;'Product Lookup'&lt;SPAN class=""&gt; table, allowing the measure to successfully compute the global average across all products&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;How to Fix This Best&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;While using your &lt;/SPAN&gt;[Overall Average Price]&lt;SPAN class=""&gt; measure works, relying on &lt;/SPAN&gt;ALL&lt;SPAN class=""&gt; inside the loop causes DAX to repeatedly calculate the global average for every single row, which is inefficient. The best practice is to compute the global average once by storing it in a &lt;/SPAN&gt;&lt;STRONG&gt;variable&lt;/STRONG&gt; &lt;I&gt;before&lt;/I&gt;&lt;SPAN class=""&gt; the &lt;/SPAN&gt;FILTER&lt;SPAN class=""&gt; iteration begins&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Because variables are constants that are evaluated in the scope where they are defined, they ignore any row contexts created later in the code&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Here is the optimal DAX pattern for your &lt;/SPAN&gt;High Ticket Orders&lt;SPAN class=""&gt; measure:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;High Ticket Orders = 
VAR GlobalAvgPrice = [Average Retail Price]
VAR HighTicketProducts = 
    FILTER(
        'Product Lookup',
        'Product Lookup'[ProductPrice] &amp;gt; GlobalAvgPrice
    )
RETURN
    CALCULATE(
        [Total Orders],
        HighTicketProducts
    )&lt;/PRE&gt;&lt;P&gt;if this solves your problem, please mark this as solved.&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 19 Mar 2026 18:20:33 GMT</pubDate>
    <dc:creator>mizan2390</dc:creator>
    <dc:date>2026-03-19T18:20:33Z</dc:date>
    <item>
      <title>DAX Behavior</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5125058#M187301</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I’m trying to understand a behavior in DAX and would appreciate your help.&lt;/P&gt;&lt;P&gt;Here are my measures:&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;DIV class=""&gt;&lt;SPAN&gt;Total Orders = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DISTINCTCOUNT(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Sales Data'[OrderNumber]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Average Retail Price = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AVERAGE(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Product Lookup'[ProductPrice]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Overall Average Price = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[Average Retail Price],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ALL('Product Lookup')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;High Ticket Orders = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[Total Orders],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FILTER(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Product Lookup',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Product Lookup'[ProductPrice] &amp;gt; [Average Retail Price]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&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;&lt;/DIV&gt;&lt;P&gt;When I use &lt;STRONG&gt;[Overall Average Price]&lt;/STRONG&gt; inside the High Ticket Orders measure (instead of [Average Retail Price]), the measure works as expected.&lt;/P&gt;&lt;P&gt;However, when I use &lt;STRONG&gt;[Average Retail Price]&lt;/STRONG&gt;, the High Ticket Orders measure returns blank in a Matrix visual — even though the Matrix has no rows or columns (only the measure in Values).&lt;/P&gt;&lt;P&gt;My question is:&lt;/P&gt;&lt;P&gt;Why does using [Average Retail Price] cause the measure to return blank, while using [Overall Average Price] works correctly?&lt;/P&gt;&lt;P&gt;What is happening in terms of filter context that explains this behavior?&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2026 17:54:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5125058#M187301</guid>
      <dc:creator>EfratY</dc:creator>
      <dc:date>2026-03-03T17:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Behavior</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5125141#M187302</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1558327" data-lia-user-login="EfratY" class="lia-mention lia-mention-user"&gt;EfratY&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The key difference comes down to filter context (and how row context from the FILTER iterator interacts with it) during evaluation of the condition inside High Ticket Orders.&lt;/P&gt;&lt;P&gt;Your &lt;SPAN&gt;High Ticket Orders&lt;/SPAN&gt; measure builds a filtered version of the &lt;SPAN&gt;'Product Lookup'&lt;/SPAN&gt; table and then uses that as a table filter argument inside &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;. The &lt;SPAN&gt;FILTER&lt;/SPAN&gt; function iterates row-by-row over &lt;SPAN&gt;'Product Lookup'&lt;/SPAN&gt; (in whatever outer filter context exists—in your empty Matrix visual, that's the full/unfiltered model). For &lt;STRONG&gt;each row&lt;/STRONG&gt;, it evaluates the boolean condition:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'Product Lookup'[ProductPrice] &amp;gt; [Some Average Measure]&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The left side (&lt;SPAN&gt;[ProductPrice]&lt;/SPAN&gt;) is a direct column reference → evaluated in &lt;STRONG&gt;row context&lt;/STRONG&gt; (the current product's price).&lt;/LI&gt;&lt;LI&gt;The right side is a &lt;STRONG&gt;measure reference&lt;/STRONG&gt; → measures always evaluate in &lt;STRONG&gt;filter context&lt;/STRONG&gt; (never directly in row context).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here's where the behavior diverges:&lt;/P&gt;&lt;H3&gt;When you use &lt;SPAN&gt;[Average Retail Price]&lt;/SPAN&gt; (the one that returns blank)&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;[Average Retail Price] = AVERAGE('Product Lookup'[ProductPrice])&lt;/SPAN&gt; is a simple aggregator with &lt;STRONG&gt;no &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt; or &lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;During the row-by-row iteration of &lt;SPAN&gt;FILTER('Product Lookup', ...)&lt;/SPAN&gt;, the evaluation of this measure ends up seeing a filter context that is effectively restricted to the &lt;STRONG&gt;current single row&lt;/STRONG&gt; being iterated (this is a common DAX "gotcha" when the measure aggregates the &lt;EM&gt;exact same table&lt;/EM&gt; the iterator is scanning, even though row context doesn't normally auto-transition to filter context).&lt;/LI&gt;&lt;LI&gt;Result: For every product row, &lt;SPAN&gt;[Average Retail Price]&lt;/SPAN&gt; evaluates to &lt;EM&gt;that row's own &lt;SPAN&gt;ProductPrice&lt;/SPAN&gt;&lt;/EM&gt; (i.e. the average of one value = the value itself).&lt;/LI&gt;&lt;LI&gt;The condition becomes &lt;SPAN&gt;ProductPrice &amp;gt; ProductPrice&lt;/SPAN&gt; → &lt;STRONG&gt;always false&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt; therefore returns an &lt;STRONG&gt;empty table&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;CALCULATE([Total Orders], &amp;lt;empty table filter on Product Lookup&amp;gt;)&lt;/SPAN&gt; propagates no products → no related sales rows → &lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt; returns &lt;STRONG&gt;blank&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This happens even in your empty Matrix (grand-total context with no slicers/row/column fields), because the per-row evaluation inside &lt;SPAN&gt;FILTER&lt;/SPAN&gt; is what introduces the restrictive context.&lt;/P&gt;&lt;H3&gt;When you use &lt;SPAN&gt;[Overall Average Price]&lt;/SPAN&gt; (the one that works)&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;[Overall Average Price] = CALCULATE([Average Retail Price], ALL('Product Lookup'))&lt;/SPAN&gt; explicitly &lt;STRONG&gt;removes every filter&lt;/STRONG&gt; on the &lt;SPAN&gt;'Product Lookup'&lt;/SPAN&gt; table (via &lt;SPAN&gt;ALL&lt;/SPAN&gt; + the outer &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;).&lt;/LI&gt;&lt;LI&gt;Even if the &lt;SPAN&gt;FILTER&lt;/SPAN&gt; iterator introduces any row-specific filtering during predicate evaluation, the &lt;SPAN&gt;ALL&lt;/SPAN&gt; wipes it out.&lt;/LI&gt;&lt;LI&gt;Result: The measure always returns the &lt;STRONG&gt;true grand-total average&lt;/STRONG&gt; across &lt;EM&gt;all&lt;/EM&gt; products (constant scalar, same for every row in the iteration).&lt;/LI&gt;&lt;LI&gt;The condition correctly identifies products where &lt;SPAN&gt;ProductPrice &amp;gt; grand average&lt;/SPAN&gt;.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt; returns the proper subset of high-price product rows.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;CALCULATE([Total Orders], &amp;lt;that filtered table&amp;gt;)&lt;/SPAN&gt; correctly counts the distinct orders linked to those products → shows the expected number.&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;Why the empty Matrix still shows this difference&lt;/H3&gt;&lt;P&gt;The grand-total context (no dimensions) means the &lt;EM&gt;outer&lt;/EM&gt; filter context is the same for both versions. But the &lt;EM&gt;internal&lt;/EM&gt; evaluation inside &lt;SPAN&gt;FILTER(...)&lt;/SPAN&gt; is what matters—and that's where the simple aggregator vs. the &lt;SPAN&gt;CALCULATE(... ALL ...)&lt;/SPAN&gt; version behaves differently.&lt;/P&gt;&lt;H3&gt;Recommended fix / best practice&lt;/H3&gt;&lt;P&gt;Don't reference the measure directly in the &lt;SPAN&gt;FILTER&lt;/SPAN&gt; predicate when it aggregates the iterated table. Instead, capture the scalar value &lt;STRONG&gt;once&lt;/STRONG&gt; (outside the iterator) with a variable:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;High Ticket Orders =&lt;/SPAN&gt;
&lt;SPAN&gt;VAR AvgPrice = [Average Retail Price]   // or [Overall Average Price] — either works now&lt;/SPAN&gt;
&lt;SPAN&gt;RETURN&lt;/SPAN&gt;
&lt;SPAN&gt;    CALCULATE(&lt;/SPAN&gt;
&lt;SPAN&gt;        [Total Orders],&lt;/SPAN&gt;
&lt;SPAN&gt;        FILTER(&lt;/SPAN&gt;
&lt;SPAN&gt;            'Product Lookup',&lt;/SPAN&gt;
&lt;SPAN&gt;            'Product Lookup'[ProductPrice] &amp;gt; AvgPrice&lt;/SPAN&gt;
&lt;SPAN&gt;        )&lt;/SPAN&gt;
&lt;SPAN&gt;    )&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;(You could also hard-code the comparison with CALCULATE([Average Retail Price], ALL('Product Lookup')) directly in the VAR, or use AVERAGEX(ALL('Product Lookup'), 'Product Lookup'[ProductPrice]).)&lt;BR /&gt;&lt;BR /&gt;I hope this helps. if so please mark it as a solution. kudos are welcome.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Mar 2026 22:46:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5125141#M187302</guid>
      <dc:creator>pcoley</dc:creator>
      <dc:date>2026-03-03T22:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Behavior</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5125145#M187303</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1558327" data-lia-user-login="EfratY" class="lia-mention lia-mention-user"&gt;EfratY&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the main points explaining what's going on:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Any measure reference in DAX is automatically wrapped in a hidden &lt;CODE&gt;CALCULATE&lt;/CODE&gt;.&lt;BR /&gt;In this case, &lt;CODE&gt;[Average Retail Price]&lt;/CODE&gt; is treated as &lt;CODE&gt;CALCULATE ( [Average Retail Price] )&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;Calling the &lt;CODE&gt;CALCULATE&lt;/CODE&gt; function within a row context causes context transition, where the row context is transformed into an equivalent filter context before evaluating the first argument of &lt;CODE&gt;CALCULATE&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;In the&amp;nbsp;&lt;CODE&gt;High Ticket Orders&lt;/CODE&gt; measure, the &lt;CODE&gt;FILTER&lt;/CODE&gt; function is an iterator which iterates over&amp;nbsp;&lt;SPAN&gt;&lt;CODE&gt;'Product Lookup'&lt;/CODE&gt;, evaluating the 2nd argument expression &lt;CODE&gt;Product Lookup'[ProductPrice] &amp;gt; [Average Retail Price]&lt;/CODE&gt; within a row context corresponding to each row of &lt;CODE&gt;'Product Lookup'&lt;/CODE&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Due to this context transition, the values of all columns of &lt;CODE&gt;'Product Lookup'&lt;/CODE&gt; in the "current row", including &lt;CODE&gt;'Product Lookup'[ProductPrice]&lt;/CODE&gt;, are added as filters when evaluating &lt;CODE&gt;[Average Retail Price]&lt;/CODE&gt;. This means&amp;nbsp;&lt;CODE&gt;[Average Retail Price]&lt;/CODE&gt; will return the average of just the single price on the current row iterated by &lt;CODE&gt;FILTER&lt;/CODE&gt;. In other words &lt;CODE&gt;[Average Retail Price]&lt;/CODE&gt; will return the same value as &lt;CODE&gt;'Product Lookup'[ProductPrice]&lt;/CODE&gt; for any given row of &lt;CODE&gt;'Product Lookup'&lt;/CODE&gt; iterated by &lt;CODE&gt;FILTER&lt;/CODE&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;As a result,&amp;nbsp;&lt;CODE&gt;'Product Lookup'[ProductPrice] &amp;gt; [Average Retail Price]&lt;/CODE&gt; is logically equivalent to&amp;nbsp;&lt;CODE&gt;'Product Lookup'[ProductPrice] &amp;gt; 'Product Lookup'[ProductPrice]&lt;/CODE&gt;, which is always false (a value is never greater than itself).&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;If you replace &lt;CODE&gt;[Average Retail Price]&lt;/CODE&gt; with &lt;CODE&gt;[Overall Average Price]&lt;/CODE&gt;, context transition still happens, but &lt;CODE&gt;[Overall Average Price]&lt;/CODE&gt; removes filters on &lt;CODE&gt;'Product Lookup'&lt;/CODE&gt; via&amp;nbsp;&lt;CODE&gt;ALL ( 'Product Lookup' )&lt;/CODE&gt; so the filters due to context transition are ignored. The value returned by &lt;CODE&gt;[Overall Average Price]&lt;/CODE&gt; would however ignore any existing filters on &lt;CODE&gt;'Product Lookup'&lt;/CODE&gt;&amp;nbsp;so would not change due to any existing filters on &lt;CODE&gt;'Product Lookup'&lt;/CODE&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;Suggested solution:&lt;/STRONG&gt;&amp;nbsp;I would generally recommend storing the value of &lt;CODE&gt;[Average Retail Price]&lt;/CODE&gt; in a variable before calling &lt;CODE&gt;FILTER&lt;/CODE&gt;. This avoids the whole context transition complication and should return the intended value. I would also recommend changing &lt;CODE&gt;FILTER ( ... )&lt;/CODE&gt; to a boolean condition within &lt;CODE&gt;KEEPFILTERS&lt;/CODE&gt;. See below:&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="markup"&gt;High Ticket Orders improved v1 =
VAR AveragePrice = [Average Retail Price]
RETURN
    CALCULATE (
        [Total Orders],
        FILTER (
            'Product Lookup',
            'Product Lookup'[ProductPrice] &amp;gt; AveragePrice
        )
    )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;High Ticket Orders improved v2 =
VAR AveragePrice = [Average Retail Price]
RETURN
    CALCULATE (
        [Total Orders],
        KEEPFILTERS ( 'Product Lookup'[ProductPrice] &amp;gt; AveragePrice )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some good reading on this topic:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/understanding-context-transition-in-dax/" target="_blank" rel="noopener"&gt;https://www.sqlbi.com/articles/understanding-context-transition-in-dax/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2026 23:16:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5125145#M187303</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2026-03-03T23:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Behavior</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5126069#M187317</link>
      <description>&lt;P&gt;Thankyou&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6799" data-lia-user-login="OwenAuger" class="lia-mention lia-mention-user"&gt;OwenAuger&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="842490" data-lia-user-login="pcoley" class="lia-mention lia-mention-user"&gt;pcoley&lt;/a&gt;&amp;nbsp; for your responses.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1558327" data-lia-user-login="EfratY" class="lia-mention lia-mention-user"&gt;EfratY&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;We appreciate your inquiry through the Microsoft Fabric Community Forum.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;We would like to inquire whether have you got the chance to check the solutions provided by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6799" data-lia-user-login="OwenAuger" class="lia-mention lia-mention-user"&gt;OwenAuger&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;and&lt;SPAN&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="842490" data-lia-user-login="pcoley" class="lia-mention lia-mention-user"&gt;pcoley&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;to resolve the issue. We hope the information provided helps to clear the query. Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2026 12:00:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5126069#M187317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2026-03-05T12:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Behavior</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5129133#M187357</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1558327" data-lia-user-login="EfratY" class="lia-mention lia-mention-user"&gt;EfratY&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 12:19:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5129133#M187357</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2026-03-10T12:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Behavior</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5135929#M187433</link>
      <description>&lt;DIV class=""&gt;&lt;SPAN class=""&gt;The behavior you are experiencing is a classic example of how &lt;/SPAN&gt;&lt;STRONG&gt;row contexts&lt;/STRONG&gt;&lt;SPAN class=""&gt;, &lt;/SPAN&gt;&lt;STRONG&gt;measure references&lt;/STRONG&gt;&lt;SPAN class=""&gt;, and &lt;/SPAN&gt;&lt;STRONG&gt;context transition&lt;/STRONG&gt;&lt;SPAN class=""&gt; interact in DAX.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Here is exactly what is happening:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;The &lt;/SPAN&gt;FILTER&lt;SPAN class=""&gt; function is an &lt;/SPAN&gt;&lt;STRONG&gt;iterator&lt;/STRONG&gt;&lt;SPAN class=""&gt;. When you write &lt;/SPAN&gt;FILTER('Product Lookup', ...)&lt;SPAN class=""&gt;, DAX scans the &lt;/SPAN&gt;'Product Lookup'&lt;SPAN class=""&gt; table row by row, creating a &lt;/SPAN&gt;&lt;STRONG&gt;row context&lt;/STRONG&gt;&lt;SPAN class=""&gt; for the evaluation of the condition&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;When you place a measure reference like &lt;/SPAN&gt;[Average Retail Price]&lt;SPAN class=""&gt; inside this row context, DAX automatically wraps it in an implicit &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; function&lt;/SPAN&gt;&lt;SPAN class=""&gt;. If &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; is executed within a row context, it triggers a &lt;/SPAN&gt;&lt;STRONG&gt;context transition&lt;/STRONG&gt;&lt;SPAN class=""&gt;. This means DAX invalidates the row context and automatically creates a new &lt;/SPAN&gt;&lt;STRONG&gt;filter context&lt;/STRONG&gt;&lt;SPAN class=""&gt; that filters the model down to the currently iterated row&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;As a result, &lt;/SPAN&gt;[Average Retail Price]&lt;SPAN class=""&gt; does not compute the grand total average of all products. Instead, because of the context transition, it computes the average retail price &lt;/SPAN&gt;&lt;I&gt;only for the current product being iterated&lt;/I&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Consequently, your logical test evaluates if the product's price is strictly greater than its own price. Because there is no product whose price is greater than itself, the condition is never met, and &lt;/SPAN&gt;FILTER&lt;SPAN class=""&gt; returns an empty table&lt;/SPAN&gt;&lt;SPAN class=""&gt;. Passing an empty table into the outer &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; to compute &lt;/SPAN&gt;[Total Orders]&lt;SPAN class=""&gt; naturally yields a &lt;/SPAN&gt;BLANK&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Your &lt;/SPAN&gt;[Overall Average Price]&lt;SPAN class=""&gt; measure is explicitly defined with the &lt;/SPAN&gt;ALL('Product Lookup')&lt;SPAN class=""&gt; modifier.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;When you use &lt;/SPAN&gt;[Overall Average Price]&lt;SPAN class=""&gt; inside &lt;/SPAN&gt;FILTER&lt;SPAN class=""&gt;, the implicit &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; still triggers a context transition that attempts to filter the calculation down to the current row&lt;/SPAN&gt;&lt;SPAN class=""&gt;. However, &lt;/SPAN&gt;CALCULATE&lt;SPAN class=""&gt; executes its operations in a very specific order: &lt;/SPAN&gt;&lt;STRONG&gt;CALCULATE modifiers (like &lt;/STRONG&gt;&lt;STRONG&gt;ALL&lt;/STRONG&gt;&lt;STRONG&gt;) are applied &lt;/STRONG&gt;&lt;STRONG&gt;after&lt;/STRONG&gt;&lt;STRONG&gt; the context transition happens&lt;/STRONG&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Because &lt;/SPAN&gt;ALL&lt;SPAN class=""&gt; is evaluated after the context transition, it acts as a filter remover and overrides the effect of the context transition&lt;/SPAN&gt;&lt;SPAN class=""&gt;. It removes the row-level filters applied to the &lt;/SPAN&gt;'Product Lookup'&lt;SPAN class=""&gt; table, allowing the measure to successfully compute the global average across all products&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;How to Fix This Best&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;While using your &lt;/SPAN&gt;[Overall Average Price]&lt;SPAN class=""&gt; measure works, relying on &lt;/SPAN&gt;ALL&lt;SPAN class=""&gt; inside the loop causes DAX to repeatedly calculate the global average for every single row, which is inefficient. The best practice is to compute the global average once by storing it in a &lt;/SPAN&gt;&lt;STRONG&gt;variable&lt;/STRONG&gt; &lt;I&gt;before&lt;/I&gt;&lt;SPAN class=""&gt; the &lt;/SPAN&gt;FILTER&lt;SPAN class=""&gt; iteration begins&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Because variables are constants that are evaluated in the scope where they are defined, they ignore any row contexts created later in the code&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Here is the optimal DAX pattern for your &lt;/SPAN&gt;High Ticket Orders&lt;SPAN class=""&gt; measure:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;High Ticket Orders = 
VAR GlobalAvgPrice = [Average Retail Price]
VAR HighTicketProducts = 
    FILTER(
        'Product Lookup',
        'Product Lookup'[ProductPrice] &amp;gt; GlobalAvgPrice
    )
RETURN
    CALCULATE(
        [Total Orders],
        HighTicketProducts
    )&lt;/PRE&gt;&lt;P&gt;if this solves your problem, please mark this as solved.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Mar 2026 18:20:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Behavior/m-p/5135929#M187433</guid>
      <dc:creator>mizan2390</dc:creator>
      <dc:date>2026-03-19T18:20:33Z</dc:date>
    </item>
  </channel>
</rss>

