<?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 differences of values of two selected coloumns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-differences-of-values-of-two-selected-coloumns/m-p/3237191#M119021</link>
    <description>&lt;P&gt;&lt;FONT&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="559340" data-lia-user-login="ZoheilSharifi" class="lia-mention lia-mention-user"&gt;ZoheilSharifi&lt;/a&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try the following methods&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the Power Query, choose first column-Unpivot Other Columns:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure1 = CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Time]),[Attribute]=MIN('Table'[Attribute])))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure2 = CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Time]),[Attribute]=MAX('Table'[Attribute])))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Difference = [Measure2]-[Measure1]&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&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 _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2023 07:49:29 GMT</pubDate>
    <dc:creator>v-zhangti</dc:creator>
    <dc:date>2023-05-16T07:49:29Z</dc:date>
    <item>
      <title>Calculate differences of values of two selected coloumns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-differences-of-values-of-two-selected-coloumns/m-p/3231580#M118602</link>
      <description>&lt;P&gt;Hello Guys,&lt;BR /&gt;I would like to know I can calculate the difference of the values of two selected coloumns:&lt;/P&gt;&lt;P&gt;The raw data is looking like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;TD&gt;Pressure 1&lt;/TD&gt;&lt;TD&gt;Pressure 2&lt;/TD&gt;&lt;TD&gt;Pressure 3&lt;/TD&gt;&lt;TD&gt;Pressure 4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;435&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;34&lt;/TD&gt;&lt;TD&gt;43&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;54&lt;/TD&gt;&lt;TD&gt;87&lt;/TD&gt;&lt;TD&gt;43&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;454&lt;/TD&gt;&lt;TD&gt;54&lt;/TD&gt;&lt;TD&gt;87&lt;/TD&gt;&lt;TD&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;54&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to use a filter which is showing the data of two selected coloumns from the table and calculating the difference.&lt;/P&gt;&lt;P&gt;At the end, all the selected coloumns, and the calculated differences should be shown on a line chart.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;BR /&gt;1) I am selecting with my slicer the coloumns Pressure 2 and Pressure 4.&lt;/P&gt;&lt;P&gt;2) PowerBI is calculating the difference of Pressure 2 and pressure 4.&lt;/P&gt;&lt;P&gt;3) In the line Chart the curve of Pressure 2 and Pressure 4 and Pressure(4-2) is shown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is important to have the dynamic function. So based on the selection of the user, the difference should be calculated based on the two selected values.&lt;BR /&gt;Hopefully it is understandable and you can help me.&lt;BR /&gt;&lt;BR /&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 19:17:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-differences-of-values-of-two-selected-coloumns/m-p/3231580#M118602</guid>
      <dc:creator>ZoheilSharifi</dc:creator>
      <dc:date>2023-05-11T19:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate differences of values of two selected coloumns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-differences-of-values-of-two-selected-coloumns/m-p/3231713#M118612</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="559340" data-lia-user-login="ZoheilSharifi" class="lia-mention lia-mention-user"&gt;ZoheilSharifi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The field parameter feature is for cases like yours.&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters" target="_blank"&gt;https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 21:38:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-differences-of-values-of-two-selected-coloumns/m-p/3231713#M118612</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-05-11T21:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate differences of values of two selected coloumns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-differences-of-values-of-two-selected-coloumns/m-p/3237191#M119021</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="559340" data-lia-user-login="ZoheilSharifi" class="lia-mention lia-mention-user"&gt;ZoheilSharifi&lt;/a&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try the following methods&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the Power Query, choose first column-Unpivot Other Columns:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure1 = CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Time]),[Attribute]=MIN('Table'[Attribute])))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure2 = CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Time]),[Attribute]=MAX('Table'[Attribute])))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Difference = [Measure2]-[Measure1]&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&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 _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 07:49:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-differences-of-values-of-two-selected-coloumns/m-p/3237191#M119021</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2023-05-16T07:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate differences of values of two selected coloumns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-differences-of-values-of-two-selected-coloumns/m-p/3239673#M119157</link>
      <description>&lt;P&gt;Thank you very much!&amp;nbsp;&lt;BR /&gt;I will try it within the next days and will let you know.&lt;BR /&gt;Teally appriciate your support :).&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 07:51:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-differences-of-values-of-two-selected-coloumns/m-p/3239673#M119157</guid>
      <dc:creator>ZoheilSharifi</dc:creator>
      <dc:date>2023-05-17T07:51:02Z</dc:date>
    </item>
  </channel>
</rss>

