<?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 total costs with different components on unpivot table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-total-costs-with-different-components-on-unpivot-table/m-p/4592768#M175884</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608313" data-lia-user-login="Clementw66666" class="lia-mention lia-mention-user"&gt;Clementw66666&lt;/a&gt;&amp;nbsp;, You can use UNPIVOT in power query then&lt;/P&gt;
&lt;P&gt;In Power BI, go to the "Modeling" tab and create a new calculated column using the following DAX formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Total Costs = &lt;BR /&gt;IF(&lt;BR /&gt;'Table'[Type] = "Total Costs",&lt;BR /&gt;'Table'[Value],&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Table'[Value]),&lt;BR /&gt;FILTER(&lt;BR /&gt;'Table',&lt;BR /&gt;'Table'[Category] = EARLIER('Table'[Category]) &amp;amp;&amp;amp;&lt;BR /&gt;'Table'[Date] = EARLIER('Table'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Total Costs by Month: Use a line chart or bar chart to show the total costs for each product by month.&lt;BR /&gt;Sub-Components Breakdown: Use a pie chart to show the breakdown of sub-components for Pizza and Pasta.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Mar 2025 11:05:13 GMT</pubDate>
    <dc:creator>bhanu_gautam</dc:creator>
    <dc:date>2025-03-03T11:05:13Z</dc:date>
    <item>
      <title>Calculate total costs with different components on unpivot table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-total-costs-with-different-components-on-unpivot-table/m-p/4592745#M175882</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table as per below screenshot. The table is about the costs of three types of products (pizza, pasta and Cola Cola).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to have the total costs for all three products by month. However, for Pizza and Pasta, there are only the sub-components for the total costs (Production + Marketing + Branch Store), and for Coca Cola there is already total costs which do not need to do a sum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the end I want to show the total costs for Pizza and Pasta as well, then using the total costs to do some analysis; if possible I would also like to keep it's sub-components, so I can create some pie-chart to connect with other charts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know how this can be done on Power BI?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance!&lt;BR /&gt;&lt;BR /&gt;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 10:51:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-total-costs-with-different-components-on-unpivot-table/m-p/4592745#M175882</guid>
      <dc:creator>Clementw66666</dc:creator>
      <dc:date>2025-03-03T10:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total costs with different components on unpivot table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-total-costs-with-different-components-on-unpivot-table/m-p/4592768#M175884</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608313" data-lia-user-login="Clementw66666" class="lia-mention lia-mention-user"&gt;Clementw66666&lt;/a&gt;&amp;nbsp;, You can use UNPIVOT in power query then&lt;/P&gt;
&lt;P&gt;In Power BI, go to the "Modeling" tab and create a new calculated column using the following DAX formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Total Costs = &lt;BR /&gt;IF(&lt;BR /&gt;'Table'[Type] = "Total Costs",&lt;BR /&gt;'Table'[Value],&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Table'[Value]),&lt;BR /&gt;FILTER(&lt;BR /&gt;'Table',&lt;BR /&gt;'Table'[Category] = EARLIER('Table'[Category]) &amp;amp;&amp;amp;&lt;BR /&gt;'Table'[Date] = EARLIER('Table'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Total Costs by Month: Use a line chart or bar chart to show the total costs for each product by month.&lt;BR /&gt;Sub-Components Breakdown: Use a pie chart to show the breakdown of sub-components for Pizza and Pasta.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 11:05:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-total-costs-with-different-components-on-unpivot-table/m-p/4592768#M175884</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-03-03T11:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total costs with different components on unpivot table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-total-costs-with-different-components-on-unpivot-table/m-p/4593003#M175891</link>
      <description>&lt;P&gt;Thank you very much!! It works.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 13:41:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-total-costs-with-different-components-on-unpivot-table/m-p/4593003#M175891</guid>
      <dc:creator>Clementw66666</dc:creator>
      <dc:date>2025-03-03T13:41:08Z</dc:date>
    </item>
  </channel>
</rss>

