<?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: Sum in different hierarchy levels in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-in-different-hierarchy-levels/m-p/4263182#M168974</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="711141" data-lia-user-login="G4analytic" class="lia-mention lia-mention-user"&gt;G4analytic&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It sounds like you’re trying to create a table that shows different aggregation levels (Store, City, Country) and you’re encountering issues when not all slicers are used. This can happen due to the way filters are applied in DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of ALL, try use ALLSELECTED.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Store = SUM(table1[total value])

City = CALCULATE(
    SUM(table1[total value]),
    ALLSELECTED(table1[Store])
)

Country = CALCULATE(
    SUM(table1[total value]),
    ALLSELECTED(table1[Store]),
    ALLSELECTED(table1[City])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not solved, try debuggin using ISFILTERED function &lt;SPAN&gt;to check if a particular column is being filtered or not.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this solved your problem, please accept it as a solution and a kudos!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Shahariar Hafiz&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2024 03:26:58 GMT</pubDate>
    <dc:creator>shafiz_p</dc:creator>
    <dc:date>2024-10-30T03:26:58Z</dc:date>
    <item>
      <title>Sum in different hierarchy levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-in-different-hierarchy-levels/m-p/4262893#M168960</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;I have been trying to create a table with 3 Slicers:&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;This is the table (as i want to see):&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;My problem is: i have created 3 measures "Store","City" and "Country" as i want to display these 3 values as differents point of view.&lt;/P&gt;&lt;P&gt;To create them:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Store = Sum(table1[total value])&lt;/P&gt;&lt;P&gt;City = Sum(table1[total value],all(table1[Store]) so the filter doesn't affect&lt;/P&gt;&lt;P&gt;Country = Sum(table1[total value],all(table1[Store]),all(table1[City]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this point, if i filter in order to see the values but i ONLY use a filter, my table doesn't work, but if i filter by the 3 slicers it works perfectly, is there a way to achieve this? My slicers are multiple choise&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an example of the error described if i only filter by City:&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;Thank you.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 20:16:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-in-different-hierarchy-levels/m-p/4262893#M168960</guid>
      <dc:creator>G4analytic</dc:creator>
      <dc:date>2024-10-29T20:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum in different hierarchy levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-in-different-hierarchy-levels/m-p/4263182#M168974</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="711141" data-lia-user-login="G4analytic" class="lia-mention lia-mention-user"&gt;G4analytic&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It sounds like you’re trying to create a table that shows different aggregation levels (Store, City, Country) and you’re encountering issues when not all slicers are used. This can happen due to the way filters are applied in DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of ALL, try use ALLSELECTED.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Store = SUM(table1[total value])

City = CALCULATE(
    SUM(table1[total value]),
    ALLSELECTED(table1[Store])
)

Country = CALCULATE(
    SUM(table1[total value]),
    ALLSELECTED(table1[Store]),
    ALLSELECTED(table1[City])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not solved, try debuggin using ISFILTERED function &lt;SPAN&gt;to check if a particular column is being filtered or not.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this solved your problem, please accept it as a solution and a kudos!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Shahariar Hafiz&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 03:26:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-in-different-hierarchy-levels/m-p/4263182#M168974</guid>
      <dc:creator>shafiz_p</dc:creator>
      <dc:date>2024-10-30T03:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sum in different hierarchy levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-in-different-hierarchy-levels/m-p/4263190#M168976</link>
      <description>&lt;P&gt;Thanks for the reply from shafiz_p&amp;nbsp;, please allow me to provide another insight:&amp;nbsp; &lt;BR /&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="711141" data-lia-user-login="G4analytic" class="lia-mention lia-mention-user"&gt;G4analytic&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Store_measure =
SUMX('table1',[total value])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;City_measure =
var _select=SELECTEDVALUE('SlicerTable'[Slicer])
RETURN
IF(
    _select="City",SUMX(FILTER(ALL('table1'),[City] in SELECTCOLUMNS('table1',"test",'table1'[City])),[total value])
    ,SUMX(FILTER(ALL('table1'),[Country]=MAX('table1'[Country])),[total value]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Country_measure =
SUMX(FILTER(ALL('table1'),[Country] in SELECTCOLUMNS('table1',"test",'table1'[Country])),[total value])&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If dax gets results that don't match your expected results, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 03:58:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-in-different-hierarchy-levels/m-p/4263190#M168976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-30T03:58:53Z</dc:date>
    </item>
  </channel>
</rss>

