<?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: % of Total Calculation with Sub-Categories in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2507786#M69488</link>
    <description>&lt;P&gt;You are welcome. You'll notice one way is taking each line (whether Cat or Sub Cat) and showing what % of total each individual line is and the other way is showing the Categories equaling the 100% and then a separate build of sub-categories reporting to a Category, with those sub cat's equaling a 100% of each individual category. Have a good one!&lt;/P&gt;</description>
    <pubDate>Wed, 11 May 2022 12:46:05 GMT</pubDate>
    <dc:creator>Whitewater100</dc:creator>
    <dc:date>2022-05-11T12:46:05Z</dc:date>
    <item>
      <title>% of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505454#M69370</link>
      <description>&lt;P&gt;Feel like I should know this but I am having an issue and need some help.&lt;/P&gt;&lt;P&gt;I want to calculate the % from Total in a report and have it calculate for both the main, and sub-level categories I have in the rows.&amp;nbsp; I know why my current formula isnt working but need some help on how to fix.&amp;nbsp; I want it to calculate from the total for both sub and main categories.&amp;nbsp; If someone can lead me in the right direction it would be greatly appreciated.&amp;nbsp; Maybe I am not even using the best formula to do this.&amp;nbsp; Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Info below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First formula will calculate the percentage correctly for the main category, but the sub displays 100% for every value.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;% of Total =&amp;nbsp; (CALCULATE(sum([Issues Reported]))/(calculate(sum([Issues Reported]),ALL(TABLE1[MAIN CATEGORY]))))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This one obviously does the opposite, calculating the % from the sub and leaving main with 100%&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;STRONG&gt;% of Total =&amp;nbsp; (CALCULATE(sum([Issues Reported]))/(calculate(sum([Issues Reported]),ALL(TABLE1[MINOR CATEGORY]))))&lt;/STRONG&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 May 2022 16:15:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505454#M69370</guid>
      <dc:creator>common763</dc:creator>
      <dc:date>2022-05-10T16:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505551#M69372</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="214200" data-lia-user-login="common763" class="lia-mention lia-mention-user"&gt;common763&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;% of Total =
VAR PercentCat =
    SUM ( TABLE1[Issues Reported] )
        / CALCULATE ( SUM ( TABLE1[Issues Reported] ), ALL ( TABLE1[MAIN CATEGORY] ) )
VAR PercentSubCat =
    SUM ( TABLE1[Issues Reported] )
        / CALCULATE ( SUM ( TABLE1[Issues Reported] ), ALL ( TABLE1[MINOR CATEGORY] ) )
RETURN
    IF ( HASONEVALUE ( TABLE1[MINOR CATEGORY] ), PercentSubCat, PercentCat )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 10 May 2022 17:06:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505551#M69372</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-10T17:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505577#M69374</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;You can try this patttern:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;* &lt;/STRONG&gt;It would be suggested you have a dimension table(say "Issues" for Cat and Sub-Cat.&amp;nbsp; Then where it says TABLE1[Main Category} or TABLE1[Minor Category] the measure below would be replaced by Issues[Category] or Issues[Sub Cat]&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Create base measure&amp;nbsp;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;U&gt;Total Amt&lt;/U&gt; = SUM([Issues REported])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MEASURE&lt;/STRONG&gt; &lt;STRONG&gt;Sales[Pct over parent]&lt;/STRONG&gt; &lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VAR&lt;/STRONG&gt;&amp;nbsp;_&lt;STRONG&gt;All =&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE&lt;/STRONG&gt; &lt;STRONG&gt;([Total Amt])&lt;/STRONG&gt;&lt;STRONG&gt;,&lt;/STRONG&gt; &lt;STRONG&gt;ALLSELECTED&lt;/STRONG&gt; &lt;STRONG&gt;()&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VAR&lt;/STRONG&gt; &lt;STRONG&gt;Category =&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE&lt;/STRONG&gt; &lt;STRONG&gt;(&lt;/STRONG&gt; &lt;STRONG&gt;[Total Amt],&lt;/STRONG&gt; &lt;STRONG&gt;ALLSELECTED&lt;/STRONG&gt; &lt;STRONG&gt;(),&lt;/STRONG&gt; &lt;STRONG&gt;VALUES&lt;/STRONG&gt; &lt;STRONG&gt;(&lt;/STRONG&gt; &lt;STRONG&gt;TABLE1[MAIN CATEGORY]&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VAR&lt;/STRONG&gt; &lt;STRONG&gt;Current =&lt;/STRONG&gt; &lt;STRONG&gt;[Total Amt]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RETURN&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SWITCH&lt;/STRONG&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TRUE&lt;/STRONG&gt; &lt;STRONG&gt;(),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ISINSCOPE&lt;/STRONG&gt; &lt;STRONG&gt;(&lt;/STRONG&gt; &lt;STRONG&gt;TABLE1[MINOR CATEGORY]&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;),&lt;/STRONG&gt; &lt;STRONG&gt;DIVIDE&lt;/STRONG&gt; &lt;STRONG&gt;(&lt;/STRONG&gt; &lt;STRONG&gt;Current,&lt;/STRONG&gt; &lt;STRONG&gt;Category ),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ISINSCOPE&lt;/STRONG&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;TABLE1[MAJOR CATEGORY]&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;),&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG&gt;DIVIDE&lt;/STRONG&gt; &lt;STRONG&gt;(&lt;/STRONG&gt; &lt;STRONG&gt;Current,&lt;/STRONG&gt;&amp;nbsp;_&lt;STRONG&gt;All )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This should show the percent of total for each Major and how the how the sub-cat builds to the category.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is what you are looking for.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 17:21:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505577#M69374</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-10T17:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505609#M69378</link>
      <description>&lt;P&gt;Thanks for taking the time with this.&amp;nbsp; I will try and get this to work then come back and comment.&amp;nbsp; Appreciate it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 17:38:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505609#M69378</guid>
      <dc:creator>common763</dc:creator>
      <dc:date>2022-05-10T17:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505790#M69391</link>
      <description>&lt;P&gt;Just noticed something.&amp;nbsp; I opted for the second solution and it is doing one thing that needs correcting.&amp;nbsp; &amp;nbsp;If there is one value in the sub-category it is displaying the percentage in the main category.&amp;nbsp; Otherwise it is doing everything correctly.&amp;nbsp; How do I tweak the below formula to display all regardless.&amp;nbsp; That would include the % of total of Main, and the sub %.&amp;nbsp; That HASONEVALUE is just putting 100% in the main category for rows with just one sub.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;IF ( HASONEVALUE ( TABLE1[MINOR CATEGORY] ), PercentSubCat, PercentCat )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 20:15:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505790#M69391</guid>
      <dc:creator>common763</dc:creator>
      <dc:date>2022-05-10T20:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505812#M69393</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Here are two different ways to solve for your question. Please see attached, using my data to make example.&lt;/P&gt;&lt;P&gt;&lt;A title="Share" href="https://drive.google.com/file/d/1J9Pf910SKSDzcDkHNu48_OM4JpzNcstd/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1J9Pf910SKSDzcDkHNu48_OM4JpzNcstd/view?usp=sharing&lt;/A&gt;&amp;nbsp;&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>Tue, 10 May 2022 20:42:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2505812#M69393</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-10T20:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2506288#M69410</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="214200" data-lia-user-login="common763" class="lia-mention lia-mention-user"&gt;common763&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes you right. Better to use ISINSCOPE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IF (ISINSCOPE ( TABLE1[MINOR CATEGORY] ), PercentSubCat, PercentCat )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 03:10:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2506288#M69410</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-11T03:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2507722#M69478</link>
      <description>&lt;P&gt;Whitewater100-I will take a look at this now.&amp;nbsp; Thanks for the post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tamerj1-Thanks also for your response.&amp;nbsp; WIll take some time with both suggestions and then post when it works correctly.&amp;nbsp; Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 12:09:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2507722#M69478</guid>
      <dc:creator>common763</dc:creator>
      <dc:date>2022-05-11T12:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2507747#M69483</link>
      <description>&lt;P&gt;Ok so Whitewater100 I plan to go through your pbix file today and get some understanding of how all of this works so thanks so much for that.&amp;nbsp; Tamerj1 I just tweaked the last part and it works perfectly so also thanks.&amp;nbsp; Here is working solution for others who may have the same issue.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;% of Total =&lt;BR /&gt;VAR PercentCat =&lt;BR /&gt;SUM ( TABLE1[Issues Reported] )&lt;BR /&gt;/ CALCULATE ( SUM ( TABLE1[Issues Reported] ), ALL ( TABLE1[MAIN CATEGORY] ) )&lt;BR /&gt;VAR PercentSubCat =&lt;BR /&gt;SUM ( TABLE1[Issues Reported] )&lt;BR /&gt;/ CALCULATE ( SUM ( TABLE1[Issues Reported] ), ALL ( TABLE1[MINOR CATEGORY] ) )&lt;BR /&gt;RETURN&lt;BR /&gt;IF ( ISINSCOPE ( TABLE1[MINOR CATEGORY] ), PercentSubCat, PercentCat )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 12:31:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2507747#M69483</guid>
      <dc:creator>common763</dc:creator>
      <dc:date>2022-05-11T12:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2507786#M69488</link>
      <description>&lt;P&gt;You are welcome. You'll notice one way is taking each line (whether Cat or Sub Cat) and showing what % of total each individual line is and the other way is showing the Categories equaling the 100% and then a separate build of sub-categories reporting to a Category, with those sub cat's equaling a 100% of each individual category. Have a good one!&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 12:46:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/2507786#M69488</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-11T12:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: % of Total Calculation with Sub-Categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/4367940#M173421</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;he i can improve the code to use with multiple levels!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%_of_Total_hierarchies =&lt;BR /&gt;VAR item_level_1 =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; SUM(monthly_sales[units])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; / CALCULATE(SUM(monthly_sales[units]), ALL(items[item_level_1]))&lt;BR /&gt;VAR item_level_2 =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; SUM(monthly_sales[units])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; / CALCULATE(SUM(monthly_sales[units]), ALL(items[item_level_2]))&lt;BR /&gt;VAR item_level_3 =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; SUM(monthly_sales[units])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; / CALCULATE(SUM(monthly_sales[units]), ALL(items[item_level_3]))&lt;BR /&gt;VAR item_level_4 =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; SUM(monthly_sales[units])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; / CALCULATE(SUM(monthly_sales[units]), ALL(items[item_level_4]))&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp; &amp;nbsp; SWITCH(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TRUE(),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ISINSCOPE(items[item_level_4]), item_level_4,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ISINSCOPE(items[item_level_3]), item_level_3,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ISINSCOPE(items[item_level_2]), item_level_2,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ISINSCOPE(items[item_level_1]), item_level_1,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BLANK()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i hope be useful&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2025 18:33:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/of-Total-Calculation-with-Sub-Categories/m-p/4367940#M173421</guid>
      <dc:creator>dbodlo</dc:creator>
      <dc:date>2025-01-16T18:33:36Z</dc:date>
    </item>
  </channel>
</rss>

