<?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: Unable to calculate grand total. Is it possible? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3708907#M144306</link>
    <description>&lt;P&gt;That's why I'm trying to check if the column is in the visual so I can make the correct calculation.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Feb 2024 19:21:10 GMT</pubDate>
    <dc:creator>Rai_BI</dc:creator>
    <dc:date>2024-02-19T19:21:10Z</dc:date>
    <item>
      <title>Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3704155#M144083</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is anyone out there a master of DAX? A Shaolin master of the DAX...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I need a DAX measure that calculates the value for each line and for the grand total according to conditionals.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the "Name Seller 1" is in scope then calculate the measure "Goal Seller 1" for each line and for the grand total. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the "Name Seller 2" is in scope then calculate the measure "Goal Seller 2" for each line and for the grand total. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If both columns "Name Seller 1" and "Name Seller 2" are in scope then calculate the sum of "Goal Seller 1" and "Goal Seller 2" for each line and for the grand total.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have the following DAX measure which works perfectly for each line, but don´t work for the grand total...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Single Measure = 

VAR Seller_1_in_Scope = HASONEFILTER('customer table'[Name Seller1])
VAR Seller_2_in_Scope = HASONEFILTER('customer table'[Name Seller2])

RETURN
SWITCH(
    TRUE(),
        Seller_1_in_Scope &amp;amp;&amp;amp; NOT Seller_2_in_Scope, 
        SUMX(
            VALUES('customer table'[Name Seller1]),[Goal Seller 1]),

        Seller_2_in_Scope &amp;amp;&amp;amp; NOT Seller_1_in_Scope, 
        SUMX(
            VALUES('customer table'[Name Seller2]),[Goal Seller 2]),

        Seller_1_in_Scope &amp;amp;&amp;amp; Seller_2_in_Scope, 
        SUMX(
            SUMMARIZE(
                'customer table',
                'customer table'[Name Seller1],'customer table'[Name Seller2]),
                CALCULATE([Goal Seller 1] + [Goal Seller 2])
        )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; I´m unable to calculate the grand total for each condition because it is returning blank. Take a look at the print.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can i fix it?&lt;BR /&gt;Download the PBIX file &lt;A href="https://lasdobrasilcombr-my.sharepoint.com/:u:/g/personal/rai_santos_las_app_br/Eax8ktdXV4VOt8gqU3ENYPABTf_V4vBpQrUfYPSOCxncsw?e=4OlKOo" target="_self"&gt;here&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 13:54:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3704155#M144083</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-02-16T13:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3704526#M144102</link>
      <description>&lt;P&gt;Do you need all the scope stuff?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd think you could write the measure much more simply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;VAR _Goal1 =
    CALCULATE (
        SUM ( goals[Goal] ),
        USERELATIONSHIP ( 'customer table'[ID Seller1], goals[Seller ID] )
    )
VAR _Goal2 =
    CALCULATE (
        SUM ( goals[Goal] ),
        USERELATIONSHIP ( 'customer table'[ID Seller2], goals[Seller ID] )
    )
RETURN
    _Goal1 + _Goal2&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 17:37:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3704526#M144102</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-02-16T17:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3704542#M144105</link>
      <description>&lt;P&gt;No,&amp;nbsp;&lt;SPAN&gt;i need a DAX measure that calculates the value for each line and for the grand total according to conditionals.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the "Name Seller 1" is in scope then calculate the measure "Goal Seller 1" for each line and for the grand total.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the "Name Seller 2" is in scope then calculate the measure "Goal Seller 2" for each line and for the grand total.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If both columns "Name Seller 1" and "Name Seller 2" are in scope then calculate the sum of "Goal Seller 1" and "Goal Seller 2" for each line and for the grand total.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 18:00:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3704542#M144105</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-02-16T18:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3704593#M144107</link>
      <description>&lt;P&gt;ISINSCOPE is largely meaningless for table visuals. Everything is always in scope.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use Matrix visuals or other visuals that support hierarchies.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 18:37:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3704593#M144107</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-16T18:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3705383#M144139</link>
      <description>&lt;P&gt;I already tried that and it didn't work&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 17:50:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3705383#M144139</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-02-17T17:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3705513#M144151</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 22:26:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3705513#M144151</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-17T22:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3705573#M144154</link>
      <description>&lt;P&gt;I already provide a PBIX file in my topic&amp;nbsp;&lt;A href="https://lasdobrasilcombr-my.sharepoint.com/:u:/g/personal/rai_santos_las_app_br/Eax8ktdXV4VOt8gqU3ENYPABTf_V4vBpQrUfYPSOCxncsw?e=4OlKOo" target="_self" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 01:35:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3705573#M144154</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-02-18T01:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3706085#M144179</link>
      <description>&lt;P&gt;Am I missing something?&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>Sun, 18 Feb 2024 16:25:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3706085#M144179</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-18T16:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3706104#M144180</link>
      <description>&lt;P&gt;It is not right. You are simply adding the two measurements together. First you need to check&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the "Name Seller 1" is in scope then calculate the measure "Goal Seller 1" for each line and for the grand total&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the "Name Seller 2" is in scope then calculate the measure "Goal Seller 2" for each line and for the grand total&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If both columns "Name Seller 1" and "Name Seller 2" are in scope then calculate the sum of "Goal Seller 1" and "Goal Seller 2" for each line and for the grand total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can only sum [Goal Seller 1] + [Name Seller 2] If both columns "Name Seller 1" and "Name Seller 2" are in the table visual&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 16:45:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3706104#M144180</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-02-18T16:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3706303#M144185</link>
      <description>&lt;P&gt;We talked about this in the other thread. The concept of scope is not applicable to flat tables. Everything is always in scope.&amp;nbsp; Maybe you can describe your requirement in different words.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 20:46:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3706303#M144185</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-18T20:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3708051#M144248</link>
      <description>&lt;P&gt;I need to create a DAX measure that calculates the sales value depending on which table column is applied to the table visual. In other words, i need to check whether a specified column is applied to the visual and then calculate the corresponding values.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a table that is basically a customer portfolio and this table contains the fields "Customer Name", "Seller Name 1" and "Seller Name 2". Each customer is served by two types of salespeople, salesperson 1 and salesperson 2.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;If the "Name Seller 1" column is applied to the visual then calculate the "Goal Seller 1" measure for each row of the visual and also for the grand total.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If the "Name Seller 2" column is applied to the visual then calculate the "Goal Seller 2" measurement for each row of the visual and also for the grand total.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If both columns "Name Seller 1" and "Name Seller 2" are applied to the visual, then calculate the sum of the two measures "Name Seller 1" and "Name Seller 2" for each row and also for the grand total.&lt;/P&gt;&lt;P&gt;See the measurement I took below using the SWITCH function, it checks the three conditionals and correctly calculates the values for each line, but the grand total value is returning empty instead of the total of the condition that is being satisfied&lt;/P&gt;&lt;LI-CODE lang="css"&gt;Single Measure = 

VAR Seller_1_in_Scope = HASONEFILTER('customer table'[Name Seller1])
VAR Seller_2_in_Scope = HASONEFILTER('customer table'[Name Seller2])

RETURN
SWITCH(
    TRUE(),
    Seller_1_in_Scope &amp;amp;&amp;amp; NOT Seller_2_in_Scope, 
    SUMX(
        VALUES('customer table'[Name Seller1]),[Goal Seller 1]),

    Seller_2_in_Scope &amp;amp;&amp;amp; NOT Seller_1_in_Scope, 
    SUMX(
        VALUES('customer table'[Name Seller2]),[Goal Seller 2]),

    Seller_1_in_Scope &amp;amp;&amp;amp; Seller_2_in_Scope, 
    SUMX(
        'customer table',
        CALCULATE([Goal Seller 1] + [Goal Seller 2])
)
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I need to ensure that the grand total returns the sum of one of the three conditions.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 12:57:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3708051#M144248</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-02-19T12:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3708213#M144264</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;I have a field parameter applied to the table with several options to add to the visual such as products, categories, months, dates and also among these options are the columns "Name Seller 1" and "Name Seller 2".&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 14:06:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3708213#M144264</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-02-19T14:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3708768#M144296</link>
      <description>&lt;P&gt;Aha, field parameters! That was unclear to me from your initial explanation. Well, bad news.&amp;nbsp; The order of selection of field parameter values can not be probed as far as I know.&amp;nbsp; Happy to be proven wrong.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 17:52:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3708768#M144296</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-19T17:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3708907#M144306</link>
      <description>&lt;P&gt;That's why I'm trying to check if the column is in the visual so I can make the correct calculation.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 19:21:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3708907#M144306</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-02-19T19:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to calculate grand total. Is it possible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3709010#M144310</link>
      <description>&lt;P&gt;You can use VALUES() against the Field Parameter to figure out if one, the other, or both are selected.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 20:52:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Unable-to-calculate-grand-total-Is-it-possible/m-p/3709010#M144310</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-19T20:52:35Z</dc:date>
    </item>
  </channel>
</rss>

