<?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: Query on PreviousWeek Function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Query-on-PreviousWeek-Function/m-p/2691581#M81073</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="422773" data-lia-user-login="Vikas_Jayara12" class="lia-mention lia-mention-user"&gt;Vikas_Jayara12&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know, there isn't&amp;nbsp;&lt;SPAN&gt;a DAX formula&amp;nbsp;to calculate data in previous week. I suggest you to add a [Start Date] which is mentioned by the blog shared by&amp;nbsp;ribisht17 to determind the week.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DimDate Table:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DimDate = 
VAR _BASIC = ADDCOLUMNS( CALENDARAUTO(),"Year",YEAR([Date]),"Month",MONTH([Date]),"WeekNum",WEEKNUM([Date],2))
VAR _ADD = ADDCOLUMNS(_BASIC,"Start Date",[Date] - WEEKDAY([Date],2)+1)
Return
_ADD&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Then create a measure based on DATEADD() function.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Last Week Sales = 
CALCULATE(SUM('Table'[Sales]),DATEADD(DimDate[Date],-7,DAY))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2022 06:57:18 GMT</pubDate>
    <dc:creator>RicoZhou2</dc:creator>
    <dc:date>2022-08-10T06:57:18Z</dc:date>
    <item>
      <title>Query on PreviousWeek Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Query-on-PreviousWeek-Function/m-p/2685577#M80623</link>
      <description>&lt;P&gt;Hi Team,&lt;BR /&gt;&lt;BR /&gt;I have used PREVIOUSDAY,&amp;nbsp;PREVIOUSMONTH,&amp;nbsp;PREVIOUSQUARTER &amp;amp; PREVIOUSYEAR function as well. However, unable to find PREVIOUSWEEK function. Just wanted to know why we don't have Previousweek function in DAX. Any specific reason?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vikas Singh Jayara&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 12:51:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Query-on-PreviousWeek-Function/m-p/2685577#M80623</guid>
      <dc:creator>Vikas_Jayara12</dc:creator>
      <dc:date>2022-08-07T12:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Query on PreviousWeek Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Query-on-PreviousWeek-Function/m-p/2685643#M80636</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="422773" data-lia-user-login="Vikas_Jayara12" class="lia-mention lia-mention-user"&gt;Vikas_Jayara12&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find this blog / solution&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Desktop/Calculate-previousweek-performance-starting-monday/m-p/2466725" target="_blank" rel="noopener"&gt;Solved: Calculate previousweek performance starting monday - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ritesh&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Mark my post as a solution if it helped you&lt;/FONT&gt;|&lt;FONT color="#000000"&gt;&amp;nbsp;Munde and Kudis (Ladies and Gentlemen) I like your Kudos!!&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;!!&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&lt;A href="https://www.youtube.com/channel/UCOK8xNgwlypFkU6aCEThCmw" target="_self" rel="nofollow noreferrer noopener"&gt;My YT Channel Dancing With Data&lt;/A&gt;&amp;nbsp;!!&amp;nbsp;&lt;A href="https://www.linkedin.com/in/ritesh-bisht-22238913/" target="_self" rel="nofollow noreferrer noopener"&gt;Connect on Linkedin&lt;/A&gt;&amp;nbsp;!!&lt;A href="https://www.youtube.com/watch?v=XE-HehSTmGo&amp;amp;list=PL9z26CJ-fucFCNaSAKlBujSFY22tZhcDr" target="_self" rel="nofollow noopener noreferrer"&gt;Power BI for Tableau Users&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 16:22:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Query-on-PreviousWeek-Function/m-p/2685643#M80636</guid>
      <dc:creator>ribisht17</dc:creator>
      <dc:date>2022-08-07T16:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Query on PreviousWeek Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Query-on-PreviousWeek-Function/m-p/2691581#M81073</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="422773" data-lia-user-login="Vikas_Jayara12" class="lia-mention lia-mention-user"&gt;Vikas_Jayara12&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know, there isn't&amp;nbsp;&lt;SPAN&gt;a DAX formula&amp;nbsp;to calculate data in previous week. I suggest you to add a [Start Date] which is mentioned by the blog shared by&amp;nbsp;ribisht17 to determind the week.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DimDate Table:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DimDate = 
VAR _BASIC = ADDCOLUMNS( CALENDARAUTO(),"Year",YEAR([Date]),"Month",MONTH([Date]),"WeekNum",WEEKNUM([Date],2))
VAR _ADD = ADDCOLUMNS(_BASIC,"Start Date",[Date] - WEEKDAY([Date],2)+1)
Return
_ADD&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Then create a measure based on DATEADD() function.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Last Week Sales = 
CALCULATE(SUM('Table'[Sales]),DATEADD(DimDate[Date],-7,DAY))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 06:57:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Query-on-PreviousWeek-Function/m-p/2691581#M81073</guid>
      <dc:creator>RicoZhou2</dc:creator>
      <dc:date>2022-08-10T06:57:18Z</dc:date>
    </item>
  </channel>
</rss>

