<?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: Grand total for subset of customers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4138806#M164414</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="697324" data-lia-user-login="MortenS" class="lia-mention lia-mention-user"&gt;MortenS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can achieve youe solution by below DAX measure as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _1 =
 CALCULATE(
    [Total Sales],
    ALLSELECTED( Customers 
    ) )
VAR _Result = 
 IF(
    MAX( Customers[Customer Type] ) = "Retail",
    _1,
IF(
    NOT ISFILTERED( Customers[Customer Name] ),
    _1
 ) )
RETURN
_Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the screenshot for your reference&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the below attachment of the pbix file&lt;/P&gt;&lt;P&gt;&lt;A href="https://we.tl/t-lUiRkJ75hX" target="_self"&gt;https://we.tl/t-lUiRkJ75hX&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;sanalytics&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If it is your solution then please like and accept it as solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Sep 2024 11:48:19 GMT</pubDate>
    <dc:creator>sanalytics</dc:creator>
    <dc:date>2024-09-07T11:48:19Z</dc:date>
    <item>
      <title>Grand total for subset of customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4138256#M164384</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a DAX problem that I have been trying to solve for some time. But for some reason, I cannot seem to wrap my head around it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have presented a simple version of the data model. Date table is intentionally left out as it has no relevance here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem: I want to write a measure that shows the grand total of all sales (8.649.004) but only shown for the customers with the customer type "Retail". For the last 4 customers the measure should produce a blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help on this challenge would be highly appriciated!&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 19:00:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4138256#M164384</guid>
      <dc:creator>MortenS</dc:creator>
      <dc:date>2024-09-06T19:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Grand total for subset of customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4138344#M164389</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="697324" data-lia-user-login="MortenS" class="lia-mention lia-mention-user"&gt;MortenS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;Total Sales - Display for Retail =&lt;BR /&gt;IF (&lt;BR /&gt;"Retail" IN VALUES ( Customer[Customer Type] ),&lt;BR /&gt;CALCULATE ( [Total Sales], ALLSELECTED ( Customer[Customer Nsme] ) )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 20:22:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4138344#M164389</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-09-06T20:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Grand total for subset of customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4138806#M164414</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="697324" data-lia-user-login="MortenS" class="lia-mention lia-mention-user"&gt;MortenS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can achieve youe solution by below DAX measure as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _1 =
 CALCULATE(
    [Total Sales],
    ALLSELECTED( Customers 
    ) )
VAR _Result = 
 IF(
    MAX( Customers[Customer Type] ) = "Retail",
    _1,
IF(
    NOT ISFILTERED( Customers[Customer Name] ),
    _1
 ) )
RETURN
_Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the screenshot for your reference&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the below attachment of the pbix file&lt;/P&gt;&lt;P&gt;&lt;A href="https://we.tl/t-lUiRkJ75hX" target="_self"&gt;https://we.tl/t-lUiRkJ75hX&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;sanalytics&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If it is your solution then please like and accept it as solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 11:48:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4138806#M164414</guid>
      <dc:creator>sanalytics</dc:creator>
      <dc:date>2024-09-07T11:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Grand total for subset of customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4139327#M164436</link>
      <description>&lt;P&gt;Here is another version:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RetailSales Total =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;TotalSales&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[TotalSales]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;REMOVEFILTERS&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Customer&lt;/SPAN&gt;&lt;SPAN&gt;[Type]&lt;/SPAN&gt;&lt;SPAN&gt;)=&lt;/SPAN&gt;&lt;SPAN&gt;"Retail"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;TotalSales&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 08 Sep 2024 15:22:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4139327#M164436</guid>
      <dc:creator>FlipFlop1</dc:creator>
      <dc:date>2024-09-08T15:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Grand total for subset of customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4139343#M164439</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your different solutions - most of them work or were easy to adapt to get to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it also be possible to get to achieve the same solution with a measure with a nested Calculate to replace the if-statement? So an outer Calculate to set the filter context of e.g. "Retail" and the inner to sum the total sales? I have tried a number of ways to get this approach to work, but I have not been able to write a useable measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate your thougts on this idea.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Sep 2024 16:30:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grand-total-for-subset-of-customers/m-p/4139343#M164439</guid>
      <dc:creator>MortenS</dc:creator>
      <dc:date>2024-09-08T16:30:26Z</dc:date>
    </item>
  </channel>
</rss>

