<?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 Analysis of Cost in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Analysis-of-Cost/m-p/3238123#M119073</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Good morning.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a question on how I can calculate the difference between values of a product in different months, for analysis of cost reduction or an increase.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much for your attention.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2023 14:44:17 GMT</pubDate>
    <dc:creator>GabrielGreg</dc:creator>
    <dc:date>2023-05-16T14:44:17Z</dc:date>
    <item>
      <title>Analysis of Cost</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Analysis-of-Cost/m-p/3238123#M119073</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Good morning.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a question on how I can calculate the difference between values of a product in different months, for analysis of cost reduction or an increase.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much for your attention.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 14:44:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Analysis-of-Cost/m-p/3238123#M119073</guid>
      <dc:creator>GabrielGreg</dc:creator>
      <dc:date>2023-05-16T14:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Analysis of Cost</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Analysis-of-Cost/m-p/3241295#M119264</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="561434" data-lia-user-login="GabrielGreg" class="lia-mention lia-mention-user"&gt;GabrielGreg&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to "&lt;SPAN&gt;calculate the difference between values of a product in different months&lt;/SPAN&gt;". I have no sample data so i create some test data in my side , you can refer to i hope it can help you.&lt;/P&gt;
&lt;P&gt;(1)This is my test data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)We can create two date table as slicers and we do not need to create ant relationship between the tables.&lt;/P&gt;
&lt;P&gt;We can click "New Table" and enter this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date = ADDCOLUMNS( CALENDAR(FIRSTDATE('Table'[Date]) , LASTDATE('Table'[Date])) ,"Year" , YEAR([Date]) ,"Month" , MONTH([Date]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Date 2 = ADDCOLUMNS( CALENDAR(FIRSTDATE('Table'[Date]) , LASTDATE('Table'[Date])) ,"Year" , YEAR([Date]) ,"Month" , MONTH([Date]))&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can create three measures like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Left_Slicer = var _t = FILTER('Table' , YEAR('Table'[Date]) =  MAX('Date'[Year])  &amp;amp;&amp;amp; MONTH('Table'[Date]) = MAX('Date'[Month]))
return
SUMX(_t , [Value])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Right_Slicer = var _t = FILTER('Table' , YEAR('Table'[Date]) =  MAX('Date 2'[Year])  &amp;amp;&amp;amp; MONTH('Table'[Date]) = MAX('Date 2'[Month]))
return
SUMX(_t , [Value])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Differences = [Right_Slicer] - [Left_Slicer]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(4)Then we can put the fields we need on the visual and we can select the slicer to select the months we need to compare and then we can get the differnece in the table visual:&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;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&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&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 02:07:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Analysis-of-Cost/m-p/3241295#M119264</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2023-05-18T02:07:27Z</dc:date>
    </item>
  </channel>
</rss>

