<?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: No CALCULATE Challenge -- Round #2b in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239629#M167771</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;The fixing of the grand total is a very straight forward solve. Jusy yet another example of incorrect measure totals in Power BI. Honestly, Power BI gets the total wrong so often, I don't even pay attention to it any longer just assuming that it is wrong as I typically turn that garbage off anyway.&lt;/P&gt;</description>
    <pubDate>Sat, 12 Oct 2024 14:45:48 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2024-10-12T14:45:48Z</dc:date>
    <item>
      <title>No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239273#M167733</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt; provided an ingenious solution to my &lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2/m-p/3189673" target="_self"&gt;No CALCULATE Challenge -- Round #2&lt;/A&gt;. However, I&amp;nbsp;couldn't easily figure out how to adapt it to a situation where the measure is non-additive and the filtering I want to do is not a single value from a column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, I want to recreate this deceptively simple measure:&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Distinct Orders (Non-China Benchmark) = 
CALCULATE (
    DISTINCTCOUNT ( Sales[OrderKey] ),
    Geography[RegionCountryName] &amp;lt;&amp;gt; "China"
)&lt;/LI-CODE&gt;
&lt;P&gt;For motivation purposes, assume China is an outlier in my data that I want to ignore for benchmarking purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that this probably isn't something I'd use on its own. It would likely be used as a denominator in another measure like this:&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Distinct Order Ratio =
DIVIDE (
    [Distinct Orders],
    CALCULATE (
        [Distinct Orders],
        Geography[RegionCountryName] &amp;lt;&amp;gt; "China"
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;For full credit:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;CALCULATE and CALCULATETABLE are not allowed.&lt;/LI&gt;
&lt;LI&gt;The measure should work in any reasonable filter context, not just for the particular sample setup.&lt;/LI&gt;
&lt;LI&gt;Ideally, the measure should also be robust to model adjustments &lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2/m-p/3189809/highlight/true#M115659" target="_self"&gt;as discussed previously&lt;/A&gt;.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;The primary goal is to find &lt;EM&gt;any&lt;/EM&gt; solution.&lt;/P&gt;
&lt;P&gt;The secondary goal is to find one that can be grokked by a non-expert.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample screenshot:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Sample PBIX file attached.&lt;BR /&gt;&lt;BR /&gt;Prior participants:&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="247314" data-lia-user-login="SharmaAntriksh" class="lia-mention lia-mention-user"&gt;SharmaAntriksh&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Other friends:&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="115827" data-lia-user-login="BA_Pete" class="lia-mention lia-mention-user"&gt;BA_Pete&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="168297" data-lia-user-login="bcdobbs" class="lia-mention lia-mention-user"&gt;bcdobbs&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24978" data-lia-user-login="smpa01" class="lia-mention lia-mention-user"&gt;smpa01&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 20:05:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239273#M167733</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-10-11T20:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239305#M167738</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DONCB = 
VAR b = SUMMARIZECOLUMNS(
			Geography[RegionCountryName],
			FILTER(
				ALL(Geography[RegionCountryName]),
				[RegionCountryName] &amp;lt;&amp;gt; "China"
			),
			"do", [Distinct Orders]
		)
		RETURN
			SUMX(
				b,
				[do]
			)&lt;/LI-CODE&gt;
&lt;P&gt;Looking at the results they seem to be off though. China accounts for 5.663 distinct order keys but the value without China only goes down by 1399.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think a more appropriate measure would be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DONCB = 
var b = SUMMARIZECOLUMNS(Geography[RegionCountryName],FILTER(ALLSELECTED(Geography[RegionCountryName]),[RegionCountryName]&amp;lt;&amp;gt;"China"),"do",DISTINCTCOUNT(Sales[OrderKey]))
return sumx(b,[do])&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 11 Oct 2024 21:38:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239305#M167738</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-11T21:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239315#M167739</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have one question&amp;nbsp;&lt;BR /&gt;Is the Same &lt;STRONG&gt;OrderKey&lt;/STRONG&gt; present for Different &lt;STRONG&gt;RegionCountryName&lt;/STRONG&gt;? Why Order key &lt;STRONG&gt;29588&lt;/STRONG&gt; is the count for &lt;STRONG&gt;Economy&lt;/STRONG&gt; class and &lt;STRONG&gt;Asia&lt;/STRONG&gt;; if we do not take into account the order key for &lt;STRONG&gt;China&lt;/STRONG&gt;, it becomes 29588-5663 = &lt;STRONG&gt;23925&lt;/STRONG&gt;; nonetheless, in your situation, it displays &lt;STRONG&gt;28189&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 21:47:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239315#M167739</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-10-11T21:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239320#M167740</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I don't Know is My above question is Valid or not but you can see my Solution&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
 var a = 
COUNTROWS(SUMMARIZECOLUMNS(
		Sales[OrderKey],
		FILTER(
			VALUES(Geography[RegionCountryName]),
			Geography[RegionCountryName] &amp;lt;&amp;gt; "China"
		),"sf",COUNTROWS(Sales)
	))
 RETURN
a&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Distinct&amp;nbsp; Order Count Except &lt;STRONG&gt;China&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Distinct Order (Non-China Benchmark) = 
SUMX(
ALLSELECTED(Geography[RegionCountryName]),
[Measure]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Ratio&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Distinct Order Ratio_ = 
DIVIDE(
[Distinct Orders],
[Distinct Order (Non-China Benchmark)]
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;My Output&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 22:00:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239320#M167740</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-10-11T22:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239363#M167746</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp;There's a visual level filter excluding a few countries, which accounts for the missing orders. It's working as intended even though it's a bit weird in this toy scenario.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 22:50:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239363#M167746</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-10-11T22:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239374#M167747</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;,&amp;nbsp;this seems to work sometimes but other times breaks for reasons I don't understand. Something seems buggy about SUMMARIZECOLUMNS inside a measure.&lt;BR /&gt;&lt;BR /&gt;I can reliably reproduce the problem by opening the file, defining [DONCB], adding it to the matrix visual (by selecting the matrix and clicking the checkbox next to the measure name in the Data pane), clearing the RegionCountryName visual filter, and then selecting all but one country (say, Armenia) in that same visual filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's (a piece of) what it looks like when I follow exactly these steps (and no others):&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 23:12:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239374#M167747</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-10-11T23:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239376#M167748</link>
      <description>&lt;P&gt;Because SUMMARIZECOLUMNS doesn't (yet) seem reliable inside a measure, I'd prefer alternative approaches if they can be found. (It's only recently that this function doesn't throw an error when used like this.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, SUMMARIZECOLUMNS is like CALCULATETABLE but arguably &lt;A href="https://learn.microsoft.com/en-us/dax/summarizecolumns-function-dax" target="_self"&gt;even more complicated&lt;/A&gt;, so IMO, it violates the spirit of the No CALCULATE ideology even though I didn't explicitly exclude it.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 23:29:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239376#M167748</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-10-11T23:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239391#M167749</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;I don't believe that the CALCULATE formula is returning the correct results. Here's why. If I add up all of the non-China distinct counts in Economy for Asia that are not China then I get 23,925. This would be a maximum number but the CALCULATE formula returns 28,189. There's no way to get that number really without adding in China's numbers to get you to 29,588 and then probably have some duplicates maybe? The point is though, I don't see how that number is possible quite frankly without ignoring the Filters pane filters for RegionCountryName which I'm not sure is or is not correct/intended.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, I would first like to ask that you prove that the 28,189 number is, in fact, correct and not something being made up by CALCULATE. Is it intended that it preserve all filters but ignore the filters in the Filters pane for RegionCountryName?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution would be the following for how the CALCULATE is working, which I feel isn't correct or at least extremely non-intuitive for the end user. I want to credit&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;here as this measure is based off of his work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DONC_D = 
    VAR __Continent = MAX( 'Geography'[ContinentName] )
    VAR b = 
        SUMMARIZE(
            FILTER(
                ALL( Geography),
                [ContinentName] = __Continent &amp;amp;&amp;amp; [RegionCountryName] &amp;lt;&amp;gt; "China"
            ),
            'Geography'[RegionCountryName],
            "do", DISTINCTCOUNT( Sales[OrderKey] )
        )
RETURN
    SUMX( b,[do] )

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 01:43:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239391#M167749</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-10-12T01:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239396#M167750</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; inside a measure, &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that measures implicitly use CALCULATE, somewhat negating your premise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Having said that, try this version&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;DONCB = 
VAR b = ADDCOLUMNS(ALL(Geography[RegionCountryName]),"do", [Distinct Orders])
RETURN SUMX(FILTER(b,[RegionCountryName]&amp;lt;&amp;gt;"China"),[do])&lt;/LI-CODE&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>Sat, 12 Oct 2024 00:33:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239396#M167750</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-12T00:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239441#M167758</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;,&amp;nbsp;the distinct count for Asia Economy without any visual filter is 33,852. The distinct count for China Economy is 5,663. The difference is 28,189, exactly as intended. I really do want to keep the things filtered out in the visual filter in my real-life measure that motivated this contrived example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your measure is close but fails on the grand total line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;, I don't think even the most extreme No CALCULATE proponents would go so far as to ban measures altogether.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your updated measure appears to work as intended so I've accepted it as a solution.&lt;BR /&gt;&lt;BR /&gt;I realize now that I didn't think carefully enough when designing the problem. In my actual application, the measure isn't additive along any dimension, so DISTINCTCOUNT isn't nonadditive enough to solve what I'm really after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a bit closer to what I'm trying to solve and might be more intuitive even though it's slightly more complex:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Median Markup =
MEDIANX ( Sales, -1 + Sales[SalesAmount] / Sales[TotalCost] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="php"&gt;Markup Non-Deluxe Ratio =
DIVIDE (
    [Median Markup],
    CALCULATE ( [Median Markup], 'Product'[ClassName] &amp;lt;&amp;gt; "Deluxe" )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just like in my post, it should be unsurprising that the denominator is the same regardless of the ClassName selected via slicers or visual filters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider this Round #2c. Ideally, the solution should be general enough that it works for any similar measure, not just the [Median Markup] example, just like it does with CALCULATE.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 03:37:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239441#M167758</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-10-12T03:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239474#M167762</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Here is a solution using SUMMARIZECOLUMNS.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Distinct Orders (Non-China Benchmark) TJ = 
COUNTROWS (
    SUMMARIZECOLUMNS ( Sales[OrderKey], 
        FILTER ( 
            ALL ( Geography[RegionCountryName] ),
            Geography[RegionCountryName] &amp;lt;&amp;gt; "China" 
        ),
        "@Count", COUNTROWS ( Sales )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;However, applying the same filter over a higher cardinality column will reveal the difference with the SUMX solution provided by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;. DISTINCTCOUNT is non-additive calculation, which means SUMX will result in wrong results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 05:18:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239474#M167762</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-10-12T05:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239512#M167765</link>
      <description>&lt;P&gt;HI,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Measure for Not taking Order count of China which are use in another for Taking Total.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
 var a = 
COUNTROWS(SUMMARIZECOLUMNS(
		Sales[OrderKey],
		FILTER(
			VALUES(Geography[RegionCountryName]),
			Geography[RegionCountryName] &amp;lt;&amp;gt; "China"
		),"sf",COUNTROWS(Sales)
	))
 RETURN
a&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Measure for&lt;STRONG&gt;&amp;nbsp;Distinct Order (Non-China Benchmark)&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Distinct Order (Non-China Benchmark)_Dangar= 
SUMX(
  ALL(
    Geography[RegionCountryName]),
    [Measure]
  )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Retio&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Distinct Order Ratio_ = 
DIVIDE([Distinct Orders],[Distinct Order (Non-China Benchmark)_Dangar])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 08:22:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239512#M167765</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-10-12T08:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239629#M167771</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;The fixing of the grand total is a very straight forward solve. Jusy yet another example of incorrect measure totals in Power BI. Honestly, Power BI gets the total wrong so often, I don't even pay attention to it any longer just assuming that it is wrong as I typically turn that garbage off anyway.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 14:45:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239629#M167771</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-10-12T14:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239635#M167773</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;So is are these measures used in the same matrix visual or a different visual?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 14:58:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239635#M167773</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-10-12T14:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239640#M167774</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;This solution appears to work when used in the same matrix as the 2b example. Including the total. Doubt it is the most efficient but seems to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
    VAR __Stores = SUMMARIZE( 'Stores', [StoreKey] )
    VAR __Products = SUMMARIZE( FILTER( ALL('Product'), [ClassName] &amp;lt;&amp;gt; "Deluxe" ), [ProductKey] )
    VAR __Divisor = MEDIANX( FILTER( ALLSELECTED('Sales'), 'Sales'[StoreKey] IN __Stores &amp;amp;&amp;amp; 'Sales'[ProductKey] IN __Products ), -1 + 'Sales'[SalesAmount] / 'Sales'[TotalCost] )
    VAR __Numerator = [Median Markup]
    VAR __Result = DIVIDE( [Median Markup], __Divisor )
RETURN
    __Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 15:29:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239640#M167774</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-10-12T15:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239679#M167777</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;I can reliably reproduce the problem by opening the file, defining [DONCB], adding it to the matrix visual (by selecting the matrix and clicking the checkbox next to the measure name in the Data pane), clearing the RegionCountryName visual filter, and then selecting all but one country (say, Armenia) in that same visual filter.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I find this rather alarming. This is something that &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="503" data-lia-user-login="jeffrey_wang" class="lia-mention lia-mention-user"&gt;jeffrey_wang&lt;/a&gt;&amp;nbsp; should be made aware of.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 17:31:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239679#M167777</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-12T17:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239736#M167780</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;Here is another version that is twice as fast and almost as fast as CALCULATE:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MRNC = 
    VAR __Stores = SUMMARIZE( 'Stores', [StoreKey] )
    VAR __Products = SUMMARIZE( FILTER( ALL( 'Product' ), [ClassName] &amp;lt;&amp;gt; "Deluxe" ), [ProductKey] )
    VAR __Table = 
        NATURALLEFTOUTERJOIN(
            NATURALLEFTOUTERJOIN(
                __Stores,
                ALLSELECTED( 'Sales' )
            ),
            __Products
        )
    VAR __Divisor = MEDIANX( __Table, -1 + [SalesAmount] / [TotalCost] )
    VAR __Numerator = [Median Markup]
    VAR __Result = DIVIDE( __Numerator, __Divisor )
RETURN
    __Result&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 12 Oct 2024 21:13:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239736#M167780</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-10-12T21:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239850#M167799</link>
      <description>&lt;P&gt;Thanks for letting me know about the SummarizeColumns bug. We'll look into this.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2024 03:52:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4239850#M167799</guid>
      <dc:creator>jeffrey_wang</dc:creator>
      <dc:date>2024-10-13T03:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4240129#M167845</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;, yeah I realized that after I saw the SUMX. I accidentally chose a column where OrderKey has only one value per sale rather than a Product filter like I initially mentioned on LinkedIn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SUMMARIZECOLUMNS does appear to be a viable more generic alternative to CALCULATETABLE and has a very similar syntax structure. If someone can understand SUMMARIZECOLUMNS, then CALCULATE should be no problem.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2024 15:31:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4240129#M167845</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-10-13T15:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: No CALCULATE Challenge -- Round #2b</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4240134#M167846</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;In fact the following formula produces the exact same query plan that the CALCULATE does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Distinct Orders (Non-China Benchmark) TJ2 = 
SUMMARIZECOLUMNS ( 
    FILTER ( 
        ALL ( Geography[RegionCountryName] ),
        Geography[RegionCountryName] &amp;lt;&amp;gt; "China" 
    ),
    "@Count", DISTINCTCOUNT ( Sales[OrderKey] )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason why the SUMX formula would work in this case is that there are no common Order Keys that could belong to different regions at the same time. For example, the first shape of your question that was posted in Linkedin was talking about "Color". The SUMX won't work in that case. It can also be simplified as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;SUMX (
    FILTER ( 
        ALL ( Geography[RegionCountryName] ),
        Geography[RegionCountryName] &amp;lt;&amp;gt; "China"
    ),
    [Distinct Orders]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But again that would work only if the each order is not related to more than one value of the filtered column. So that would work in the Store side of the data model wbut won't work in the 'Product' or the Customer side of the data model.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 02:41:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/No-CALCULATE-Challenge-Round-2b/m-p/4240134#M167846</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-10-14T02:41:05Z</dc:date>
    </item>
  </channel>
</rss>

