<?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: Calculate the different column total based on Filter value. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2666901#M79321</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this result you want?&lt;/P&gt;
&lt;P&gt;When I choose one country, the result is sum of “Local_value” , as the sample shows “9”,&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;When I choose two countries, it returns “6”, which is sum of “Global_value”:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If this result can meet your command, you can try this measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = IF(COUNTROWS(VALUES('Table 1'[country_name]))&amp;gt;1 ,SUM('Table 2'[Global_value]),SUM('Table 2'[Local_value]))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this is my testing pbix file, you also can view it for better understanding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have misunderstood your meaning, please let me know in time。&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Community Support Team&amp;nbsp;&lt;STRONG&gt;Selina&amp;nbsp;zhu&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 08:57:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-07-28T08:57:52Z</dc:date>
    <item>
      <title>Calculate the different column total based on Filter value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2658931#M78757</link>
      <description>&lt;P&gt;Report contains data of multiple Countries.(For now only two countries i.e USA,CANADA) in &lt;STRONG&gt;Coutry_Name&lt;/STRONG&gt; field. Created filter(multi selected) by using slicer to select Country names. We are having &lt;STRONG&gt;Local_Amount&lt;/STRONG&gt; value, and &lt;STRONG&gt;Global_Value&lt;/STRONG&gt; in table level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we select multiple countries(Multiple values in the filter) in the report filter, it must calculate sum(&lt;STRONG&gt;Global_Value&lt;/STRONG&gt;), if we select one country then it must calculate the sum(&lt;STRONG&gt;Local_Value&lt;/STRONG&gt;).&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 10:48:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2658931#M78757</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-25T10:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the different column total based on Filter value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2659092#M78765</link>
      <description>&lt;P&gt;You can try if condition:&lt;/P&gt;&lt;P&gt;Result = IF ( HASONEVALUE ( 'Table'[Country_Name] ) &amp;gt; 1 , Global_Value , Local_Amount )&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;Result = IF ( COUNTROWS ( VALUES ('Table'[Country_Name]) ) &amp;gt; 1 , Global_Value , Local_Amount )&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 12:06:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2659092#M78765</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2022-07-25T12:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the different column total based on Filter value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2659093#M78766</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the &lt;A href="https://dax.guide/hasonefilter" target="_blank" rel="noopener"&gt;HASONEFILTER&lt;/A&gt; function to detect whether one or many countries have been selected.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 12:06:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2659093#M78766</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-07-25T12:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the different column total based on Filter value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2659096#M78767</link>
      <description>&lt;P&gt;Please, could you sent us the screenshot=)&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 12:08:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2659096#M78767</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2022-07-25T12:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the different column total based on Filter value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2666901#M79321</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this result you want?&lt;/P&gt;
&lt;P&gt;When I choose one country, the result is sum of “Local_value” , as the sample shows “9”,&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;When I choose two countries, it returns “6”, which is sum of “Global_value”:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If this result can meet your command, you can try this measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = IF(COUNTROWS(VALUES('Table 1'[country_name]))&amp;gt;1 ,SUM('Table 2'[Global_value]),SUM('Table 2'[Local_value]))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this is my testing pbix file, you also can view it for better understanding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have misunderstood your meaning, please let me know in time。&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Community Support Team&amp;nbsp;&lt;STRONG&gt;Selina&amp;nbsp;zhu&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 08:57:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2666901#M79321</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-28T08:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the different column total based on Filter value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2667001#M79330</link>
      <description>&lt;P&gt;HASONEVALUE is not the right function to use here since it works on cross-filters as well. HASONEFILTER works on direct filters only and this is precisely what this task calls for.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 09:29:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-different-column-total-based-on-Filter-value/m-p/2667001#M79330</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-07-28T09:29:27Z</dc:date>
    </item>
  </channel>
</rss>

