<?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 Calculating difference in two fields from the same column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-difference-in-two-fields-from-the-same-column/m-p/3358694#M126248</link>
    <description>&lt;P&gt;We have a list of opportunities with stages and each stage has a date associated with it based on when it was last updated. In PowerQuery, the stages are all in one column and the dates are all in one column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How do you calculate the date difference between the two stages (New and Closed Won) when both of them are in the same column?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: Attaching both the PowerBI table (filtered to show only New and Closed Won stages) and the PowerQuery for reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Aug 2023 01:36:24 GMT</pubDate>
    <dc:creator>stan255tf</dc:creator>
    <dc:date>2023-08-02T01:36:24Z</dc:date>
    <item>
      <title>Calculating difference in two fields from the same column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-difference-in-two-fields-from-the-same-column/m-p/3358694#M126248</link>
      <description>&lt;P&gt;We have a list of opportunities with stages and each stage has a date associated with it based on when it was last updated. In PowerQuery, the stages are all in one column and the dates are all in one column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How do you calculate the date difference between the two stages (New and Closed Won) when both of them are in the same column?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: Attaching both the PowerBI table (filtered to show only New and Closed Won stages) and the PowerQuery for reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 01:36:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-difference-in-two-fields-from-the-same-column/m-p/3358694#M126248</guid>
      <dc:creator>stan255tf</dc:creator>
      <dc:date>2023-08-02T01:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating difference in two fields from the same column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-difference-in-two-fields-from-the-same-column/m-p/3361070#M126354</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="596313" data-lia-user-login="stan255tf" class="lia-mention lia-mention-user"&gt;stan255tf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the data you provided, you can try the following.&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;New Date = CALCULATE(MAX('Table'[CreatedDate]),FILTER(ALL('Table'),[StageName]="1. New"&amp;amp;&amp;amp;[ID]=SELECTEDVALUE('Table'[ID])))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Closed Lost Date = CALCULATE(MAX('Table'[CreatedDate]),FILTER(ALL('Table'),[StageName]="8. Cloesd Lost"&amp;amp;&amp;amp;[ID]=SELECTEDVALUE('Table'[ID])))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Difference = DATEDIFF([New Date],[Closed Lost Date],DAY)&lt;/LI-CODE&gt;
&lt;P&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;STRONG&gt;helps, then please consider&amp;nbsp;&lt;EM&gt;Accept it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 06:16:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-difference-in-two-fields-from-the-same-column/m-p/3361070#M126354</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2023-08-02T06:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating difference in two fields from the same column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-difference-in-two-fields-from-the-same-column/m-p/3362704#M126436</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332147" data-lia-user-login="v-zhangti" class="lia-mention lia-mention-user"&gt;v-zhangti&lt;/a&gt;, this worked.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 01:46:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-difference-in-two-fields-from-the-same-column/m-p/3362704#M126436</guid>
      <dc:creator>stan255tf</dc:creator>
      <dc:date>2023-08-03T01:46:43Z</dc:date>
    </item>
  </channel>
</rss>

