<?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 Offset Function not reading previous row. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233144#M118706</link>
    <description>&lt;P&gt;Maybe a person here can help me, because searching and support cannot.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The offset function seemed like what I wanted but I have not gotten it to work. I made a mockup sheet today to figure out if it was some sort or model connection I made on my actual work that was just breaking the function, but the problem persists.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is what I have:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;with the fourth column from this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DAX's idea of an "offset" = 

OFFSET(
    -1,
    ALL(Sheet1[Units]),
    ORDERBY(Sheet1[Lot])
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As you might notice, the offset performed on [Units] that results from this function isn't giving me the previous row as it appears in the table, it's giving me the next smallest value from the relation. I was under the impression that ORDERBY would allow me to force it to follow the order of the [Lot] column, but clearly I am mistaken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The third column is simply an example of what I want from a custom column, one where it does not abandon its relation to the other columns' order.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can anyone help?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 May 2023 15:31:04 GMT</pubDate>
    <dc:creator>asundquist</dc:creator>
    <dc:date>2023-05-12T15:31:04Z</dc:date>
    <item>
      <title>Offset Function not reading previous row.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233144#M118706</link>
      <description>&lt;P&gt;Maybe a person here can help me, because searching and support cannot.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The offset function seemed like what I wanted but I have not gotten it to work. I made a mockup sheet today to figure out if it was some sort or model connection I made on my actual work that was just breaking the function, but the problem persists.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is what I have:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;with the fourth column from this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DAX's idea of an "offset" = 

OFFSET(
    -1,
    ALL(Sheet1[Units]),
    ORDERBY(Sheet1[Lot])
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As you might notice, the offset performed on [Units] that results from this function isn't giving me the previous row as it appears in the table, it's giving me the next smallest value from the relation. I was under the impression that ORDERBY would allow me to force it to follow the order of the [Lot] column, but clearly I am mistaken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The third column is simply an example of what I want from a custom column, one where it does not abandon its relation to the other columns' order.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can anyone help?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 15:31:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233144#M118706</guid>
      <dc:creator>asundquist</dc:creator>
      <dc:date>2023-05-12T15:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Offset Function not reading previous row.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233207#M118708</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="525548" data-lia-user-login="asundquist" class="lia-mention lia-mention-user"&gt;asundquist&lt;/a&gt;&amp;nbsp;You don't need OFFSET for this, you can use the MTBF pattern.&amp;nbsp;See my article on Mean Time Between Failure (MTBF) which uses EARLIER: &lt;A href="http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586" target="_blank"&gt;http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586&lt;/A&gt;.&lt;BR /&gt;The basic pattern is:&lt;BR /&gt;Column =&amp;nbsp;&lt;BR /&gt;&amp;nbsp; VAR __Current = [Value]&lt;BR /&gt;&amp;nbsp; VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] &amp;lt; EARLIER('Table'[Date])),[Date])&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp; __Current - __Previous&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, OFFSET gets wonky at times. It's certainly not easy or intuitive to use.&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/oxe4u8PgG0Y" data-video-remote-vid="https://youtu.be/oxe4u8PgG0Y" class="lia-video-container lia-media-is-center lia-media-size-medium"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Foxe4u8PgG0Y%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Doxe4u8PgG0Y&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Foxe4u8PgG0Y%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 15:59:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233207#M118708</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-05-12T15:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Offset Function not reading previous row.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233252#M118710</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I sort of agree with you. I don't know how these functions really work and they don't produce consistent results when used within a filter context of a visual. Their behavior seem to be extremely difficult to understand. I prefer to do my things manually if you would say as I like to tell the engine what exactly I want it to do and how to do it rather that yhan relaying on a black box function that until now it doesn't seem that there is a way to verify what does it exactly do in different scenarios.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 16:53:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233252#M118710</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-05-12T16:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Offset Function not reading previous row.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233295#M118717</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;Thanks for the fast response! I have a follow up question:&lt;BR /&gt;&lt;BR /&gt;Is there anyway to allow your solution to go the opposite way, or to be offset by more than one space, like I expected OFFSET to be capable of?&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 17:29:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233295#M118717</guid>
      <dc:creator>asundquist</dc:creator>
      <dc:date>2023-05-12T17:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Offset Function not reading previous row.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233350#M118730</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="525548" data-lia-user-login="asundquist" class="lia-mention lia-mention-user"&gt;asundquist&lt;/a&gt;&amp;nbsp;Oh yeah, there's all kind of fancy stuff you can do without those functions. Most of it involves abusing CONCATENATEX and torturing the PATHITEM function. Like this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Mythical-DAX-Index/m-p/1093214#M528" target="_blank"&gt;The Mythical DAX Index - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe the OFFSET, INDEX and WINDOW functions are pre-cursors and building blocks for visual level DAX calculations (which are a bad idea to begin with IMHO). They really only work under the very specific circumstances that are documented in the blog article for their release and there's just too many ways to break them right now in my opinion. If they really are the building blocks for DAX visual level calculations, those are going to be a nightmare.&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 18:30:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Offset-Function-not-reading-previous-row/m-p/3233350#M118730</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-05-12T18:30:07Z</dc:date>
    </item>
  </channel>
</rss>

