<?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: Retrospecive analysis based on Status History table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrospecive-analysis-based-on-Status-History-table/m-p/3367826#M126677</link>
    <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343948" data-lia-user-login="IvanS" class="lia-mention lia-mention-user"&gt;IvanS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
SWITCH(
    TRUE(),
    MONTH('Table'[LastModifiedTime])=6&amp;amp;&amp;amp;    'Table'[LastModifiedTime]=MAXX(FILTER(ALL('Table'),'Table'[Dealld]=EARLIER('Table'[Dealld])&amp;amp;&amp;amp;YEAR('Table'[LastModifiedTime])=YEAR(EARLIER('Table'[LastModifiedTime]))&amp;amp;&amp;amp;MONTH('Table'[LastModifiedTime])=MONTH(EARLIER('Table'[LastModifiedTime]))),[LastModifiedTime]),"Agreement accepted",
    MONTH('Table'[LastModifiedTime])=7&amp;amp;&amp;amp;  'Table'[LastModifiedTime]=MAXX(FILTER(ALL('Table'),'Table'[Dealld]=EARLIER('Table'[Dealld])&amp;amp;&amp;amp;YEAR('Table'[LastModifiedTime])=YEAR(EARLIER('Table'[LastModifiedTime]))&amp;amp;&amp;amp;MONTH('Table'[LastModifiedTime])=MONTH(EARLIER('Table'[LastModifiedTime]))),[LastModifiedTime]),"Agreement signed",
    MONTH('Table'[LastModifiedTime])=8&amp;amp;&amp;amp;   'Table'[LastModifiedTime]=MAXX(FILTER(ALL('Table'),'Table'[Dealld]=EARLIER('Table'[Dealld])&amp;amp;&amp;amp;YEAR('Table'[LastModifiedTime])=YEAR(EARLIER('Table'[LastModifiedTime]))&amp;amp;&amp;amp;MONTH('Table'[LastModifiedTime])=MONTH(EARLIER('Table'[LastModifiedTime]))),[LastModifiedTime]),"newest status","Data collecting")&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see if it meets your expected results, if not, you can show the expected results in the form of pictures, we can help you better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2023 07:32:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-07T07:32:37Z</dc:date>
    <item>
      <title>Retrospecive analysis based on Status History table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrospecive-analysis-based-on-Status-History-table/m-p/3366701#M126612</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on one request where I need to provide retrospecitve analysis of statuses by the end of each month (previous, pre-previous etc.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, I need to recalculate status as it was by end of the previous months using the table Status History&amp;nbsp;with following fields:&lt;/P&gt;&lt;P&gt;1. Deal ID&lt;/P&gt;&lt;P&gt;2. Deal Amount&lt;/P&gt;&lt;P&gt;3. Status&lt;/P&gt;&lt;P&gt;4. Modified date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find below example - for this particular deal, the measure will count the statuses as per below:&lt;/P&gt;&lt;P&gt;31st of May - deal was not created yet therefore it will &lt;STRONG&gt;not be counted into any status&lt;/STRONG&gt; (this applies also for all months before May)&lt;/P&gt;&lt;P&gt;30th of June - based on checking last status in June, deal will be counted under status&amp;nbsp;&lt;STRONG&gt;Agreement accepted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;31st of July -&amp;nbsp;based on checking last status in June, deal will be counted under status&amp;nbsp;&lt;STRONG&gt;Agreement signed&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;31st of August - measure to check if there was recent change in August (for example Completed), if yes, then to count deal under newest status and if no, then to keep counting the deal under the &lt;STRONG&gt;Agreement signed&lt;/STRONG&gt; status&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;&lt;P&gt;Thank you for any help&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Aug 2023 23:24:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrospecive-analysis-based-on-Status-History-table/m-p/3366701#M126612</guid>
      <dc:creator>IvanS</dc:creator>
      <dc:date>2023-08-05T23:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Retrospecive analysis based on Status History table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrospecive-analysis-based-on-Status-History-table/m-p/3367826#M126677</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343948" data-lia-user-login="IvanS" class="lia-mention lia-mention-user"&gt;IvanS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
SWITCH(
    TRUE(),
    MONTH('Table'[LastModifiedTime])=6&amp;amp;&amp;amp;    'Table'[LastModifiedTime]=MAXX(FILTER(ALL('Table'),'Table'[Dealld]=EARLIER('Table'[Dealld])&amp;amp;&amp;amp;YEAR('Table'[LastModifiedTime])=YEAR(EARLIER('Table'[LastModifiedTime]))&amp;amp;&amp;amp;MONTH('Table'[LastModifiedTime])=MONTH(EARLIER('Table'[LastModifiedTime]))),[LastModifiedTime]),"Agreement accepted",
    MONTH('Table'[LastModifiedTime])=7&amp;amp;&amp;amp;  'Table'[LastModifiedTime]=MAXX(FILTER(ALL('Table'),'Table'[Dealld]=EARLIER('Table'[Dealld])&amp;amp;&amp;amp;YEAR('Table'[LastModifiedTime])=YEAR(EARLIER('Table'[LastModifiedTime]))&amp;amp;&amp;amp;MONTH('Table'[LastModifiedTime])=MONTH(EARLIER('Table'[LastModifiedTime]))),[LastModifiedTime]),"Agreement signed",
    MONTH('Table'[LastModifiedTime])=8&amp;amp;&amp;amp;   'Table'[LastModifiedTime]=MAXX(FILTER(ALL('Table'),'Table'[Dealld]=EARLIER('Table'[Dealld])&amp;amp;&amp;amp;YEAR('Table'[LastModifiedTime])=YEAR(EARLIER('Table'[LastModifiedTime]))&amp;amp;&amp;amp;MONTH('Table'[LastModifiedTime])=MONTH(EARLIER('Table'[LastModifiedTime]))),[LastModifiedTime]),"newest status","Data collecting")&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see if it meets your expected results, if not, you can show the expected results in the form of pictures, we can help you better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 07:32:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrospecive-analysis-based-on-Status-History-table/m-p/3367826#M126677</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-07T07:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Retrospecive analysis based on Status History table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrospecive-analysis-based-on-Status-History-table/m-p/3368888#M126743</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;seems that we misunderstood. I see in your DAX function the month order which is hard-coded value. But I need to have this dynamic. The result is pretty easy to describe.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on table that is tracking status history, I need to retrospetively calculate the number of deals per it's status by end of each month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in case we have only 1 deal as per my previous screenshot (and there would be no other deal), the result will look like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Date (from Date table) - end of month&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;TD&gt;Nr. of Deals&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;June 2023&lt;/TD&gt;&lt;TD&gt;Agreement accepted&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;July 2023&lt;/TD&gt;&lt;TD&gt;Agreement signed&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;August 2023&lt;/TD&gt;&lt;TD&gt;Agreement signed&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;September 2023&lt;/TD&gt;&lt;TD&gt;Agreement signed&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;October 2023&lt;/TD&gt;&lt;TD&gt;Agreement signed&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;November 2023&lt;/TD&gt;&lt;TD&gt;Agreement signed&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;December 2023&lt;/TD&gt;&lt;TD&gt;Agreement signed&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having more deals and status changes, there will be more lines for each month where we had at least 1 deal in the history.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it is more clear now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 17:34:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrospecive-analysis-based-on-Status-History-table/m-p/3368888#M126743</guid>
      <dc:creator>IvanS</dc:creator>
      <dc:date>2023-08-07T17:34:05Z</dc:date>
    </item>
  </channel>
</rss>

