<?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: Having trouble getting Offset function to work - trying to calculate performance vs prior week in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Having-trouble-getting-Offset-function-to-work-trying-to/m-p/4015847#M158269</link>
    <description>&lt;P&gt;Thank you for your help!&lt;BR /&gt;&lt;BR /&gt;Any idea why the measure I copied from you is not working?&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;</description>
    <pubDate>Fri, 28 Jun 2024 14:30:59 GMT</pubDate>
    <dc:creator>DeerCamp</dc:creator>
    <dc:date>2024-06-28T14:30:59Z</dc:date>
    <item>
      <title>Having trouble getting Offset function to work - trying to calculate performance vs prior week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Having-trouble-getting-Offset-function-to-work-trying-to/m-p/4014193#M158133</link>
      <description>&lt;P&gt;My calendar table looks like this. I inserted custom column to calculate offset weeks from today.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am now trying to create a measure like this from something I saw on here.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The problem is that it will not let me pull in my actual calendar table (Called "Calendar Week to Date" )&lt;BR /&gt;&lt;BR /&gt;Am I doing this wrong?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 20:39:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Having-trouble-getting-Offset-function-to-work-trying-to/m-p/4014193#M158133</guid>
      <dc:creator>DeerCamp</dc:creator>
      <dc:date>2024-06-27T20:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble getting Offset function to work - trying to calculate performance vs prior week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Having-trouble-getting-Offset-function-to-work-trying-to/m-p/4014247#M158134</link>
      <description>&lt;P&gt;It looks like the DAX you're having trouble with is for a calculated column, whereas you're trying to create a measure. While they both use DAX code, you've usually gotta be more careful with measures because of the different contexts in a visual vs a table - i recommend taking a read of these two articles:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/row-context-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/row-context-in-dax/&lt;/A&gt; and&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/filter-context-in-dax-explained-visually/" target="_blank"&gt;https://www.sqlbi.com/articles/filter-context-in-dax-explained-visually/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now to fix your issue - you can try to wrap your 'Calendar'[Date] with MAX, i.e&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Week offset = 
var StartOfWeek = MAX('Calendar'[Date]) - WEEKDAY(MAX('Calendar'[Date]), 2) + 1)
... etc.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you're trying to calculate the previous week, you should also be able to do the same by using the DATESINPERIOD function:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/datesinperiod-function-dax" target="_blank"&gt;https://learn.microsoft.com/en-us/dax/datesinperiod-function-dax&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I would do something like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous Week Measure = CALCULATE([Current Week Measure], DATESINPERIOD('Calendar'[Date], MAX('Calendar'[Date], -7, DAY))&lt;/LI-CODE&gt;
&lt;P&gt;If you need more detailed help, you can try be more specific about what your expected inputs and results are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 22:49:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Having-trouble-getting-Offset-function-to-work-trying-to/m-p/4014247#M158134</guid>
      <dc:creator>vicky_</dc:creator>
      <dc:date>2024-06-27T22:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble getting Offset function to work - trying to calculate performance vs prior week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Having-trouble-getting-Offset-function-to-work-trying-to/m-p/4015847#M158269</link>
      <description>&lt;P&gt;Thank you for your help!&lt;BR /&gt;&lt;BR /&gt;Any idea why the measure I copied from you is not working?&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;</description>
      <pubDate>Fri, 28 Jun 2024 14:30:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Having-trouble-getting-Offset-function-to-work-trying-to/m-p/4015847#M158269</guid>
      <dc:creator>DeerCamp</dc:creator>
      <dc:date>2024-06-28T14:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble getting Offset function to work - trying to calculate performance vs prior week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Having-trouble-getting-Offset-function-to-work-trying-to/m-p/4017187#M158376</link>
      <description>&lt;P&gt;Help?&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2024 15:36:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Having-trouble-getting-Offset-function-to-work-trying-to/m-p/4017187#M158376</guid>
      <dc:creator>DeerCamp</dc:creator>
      <dc:date>2024-06-30T15:36:18Z</dc:date>
    </item>
  </channel>
</rss>

