<?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: Using OFFSET (and partition) to subtract row values that are grouped in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027512#M103293</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.&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;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Forecast-Baseline CC =
VAR _offsetresult =
    MAXX (
        OFFSET (
            -1,
            SUMMARIZE ( Matrix, Matrix[CIM #], Matrix[Date Dataset], Matrix[Date] ),
            ORDERBY ( Matrix[Date Dataset], ASC ),
            KEEP,
            PARTITIONBY ( Matrix[CIM #] )
        ),
        Matrix[Date]
    )
RETURN
    IF ( _offsetresult &amp;lt;&amp;gt; BLANK (), DATEDIFF ( _offsetresult, Matrix[Date], DAY ) )
&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 18 Jan 2023 04:46:52 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-01-18T04:46:52Z</dc:date>
    <item>
      <title>Using OFFSET (and partition) to subtract row values that are grouped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027416#M103284</link>
      <description>&lt;P&gt;Hello PowerBI Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to use the new OFFSET function in order to find the difference between two dates, but within groups. I think the OFFSET (with partition) would be ideal but I cannot get it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data is as follows:&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;The output I am after is that;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Row 1 &amp;amp; 2, "Forecast - Baseline" should read the difference between the 23/5/2023 and 22/3/2023, i.e: x63 days&lt;/P&gt;&lt;P&gt;Row 3 &amp;amp; 4,&amp;nbsp;"Forecast - Baseline" should read the difference between the 21/6/2024 and 21/6/2024, i.e: x0 days&lt;/P&gt;&lt;P&gt;Row 5 &amp;amp; 6,&amp;nbsp;"Forecast - Baseline" should read the difference between the 24/10/2024 and 30/10/2024, i.e: x7 days&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have spent a number of days on this (I am just starting off with PowerBI) and the closest DAX I wrote was as follows;&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;I get a circular dependency error, amongst other errors with other methods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would prefer to attach the PowerBI file but can't seem to find how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can help me, thanks very much.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards, Chris.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 03:02:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027416#M103284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-18T03:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using OFFSET (and partition) to subtract row values that are grouped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027512#M103293</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.&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;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Forecast-Baseline CC =
VAR _offsetresult =
    MAXX (
        OFFSET (
            -1,
            SUMMARIZE ( Matrix, Matrix[CIM #], Matrix[Date Dataset], Matrix[Date] ),
            ORDERBY ( Matrix[Date Dataset], ASC ),
            KEEP,
            PARTITIONBY ( Matrix[CIM #] )
        ),
        Matrix[Date]
    )
RETURN
    IF ( _offsetresult &amp;lt;&amp;gt; BLANK (), DATEDIFF ( _offsetresult, Matrix[Date], DAY ) )
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 Jan 2023 04:46:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027512#M103293</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-01-18T04:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using OFFSET (and partition) to subtract row values that are grouped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027533#M103294</link>
      <description>&lt;P&gt;Hi Jihwan_Kim,&lt;/P&gt;&lt;P&gt;That is great. Is there a way to have the values in the blank cells as well, i.e: 62 in Row 1 &amp;amp; Row 2, 0 in Row 3 &amp;amp; Row 4, etc. I expect I need this when I create the line chart.&lt;/P&gt;&lt;P&gt;Regards, Chris.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 04:57:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027533#M103294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-18T04:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using OFFSET (and partition) to subtract row values that are grouped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027638#M103302</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thank you for your message.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;If you want to see the results that are higher than zero, please try using ABS DAX function together.&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;LI-CODE lang="markup"&gt;Forecast-Baseline CC = 
VAR _offsetresult =
    MAXX (
        OFFSET (
            -1,
            SUMMARIZE ( Matrix, Matrix[CIM #], Matrix[Date Dataset], Matrix[Date] ),
            ORDERBY ( Matrix[Date Dataset], ASC ),
            KEEP,
            PARTITIONBY ( Matrix[CIM #] )
        ),
        Matrix[Date]
    )
VAR _offsetresultreverse =
    MAXX (
        OFFSET (
            -1,
            SUMMARIZE ( Matrix, Matrix[CIM #], Matrix[Date Dataset], Matrix[Date] ),
            ORDERBY ( Matrix[Date Dataset], DESC ),
            KEEP,
            PARTITIONBY ( Matrix[CIM #] )
        ),
        Matrix[Date]
    )
RETURN
    IF ( _offsetresult &amp;lt;&amp;gt; BLANK (), DATEDIFF ( _offsetresult, Matrix[Date], DAY ), DATEDIFF (  Matrix[Date], _offsetresultreverse, DAY )  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 05:56:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027638#M103302</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-01-18T05:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using OFFSET (and partition) to subtract row values that are grouped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027653#M103304</link>
      <description>&lt;P&gt;Amazing Jihwan_Kim, thank you so much for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 06:01:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3027653#M103304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-18T06:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using OFFSET (and partition) to subtract row values that are grouped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3029846#M103494</link>
      <description>&lt;P&gt;Hello PowerBI community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution above is correct (thanks Jihwan_Kim!), but in incorporating the real data I have uncovered another problem I am hoping I could get some help with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The intent of this graph is to show the slip/gain or neutral status of project milestones (in reality there would be a lot more more than three).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The lines are now correctly being formatted if the milestone slips (red), stays the same/neutral (grey) or is brought forward/gain (green)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What is happening now is that if a date of a line moves past another line/dot, it splits up the line. The first picture is correct (with limited sample data), but if I move the end date of the red line past the 21/6/2024 (the grey dot) the line splits into two dots.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As an aside, if anyone can tell me how to upload the *.pbix file, I am happy to share it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards, Chris.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 23:32:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-OFFSET-and-partition-to-subtract-row-values-that-are/m-p/3029846#M103494</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-18T23:32:26Z</dc:date>
    </item>
  </channel>
</rss>

