<?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 How to get Previous Custom Week end date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-Previous-Custom-Week-end-date/m-p/1475927#M28086</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm fairly new to Power BI and DAX and haven't found a solution that fits my current problem. I'd like to calculate the totals for previous week. My date table contains the custom week end&amp;nbsp;column. For example &amp;nbsp;if&amp;nbsp;date 4th November 2020, the custom weekend date is 8/11/2020. I'd like to find out if there's a way to compare to the total from previous week end date depending on the selected date on the filter.&amp;nbsp; If the user selects 28 October 2020, I'd like to find out the total from previous week = 25/10/2020.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or&amp;nbsp;advise will be really appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2020 07:05:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-05T07:05:23Z</dc:date>
    <item>
      <title>How to get Previous Custom Week end date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-Previous-Custom-Week-end-date/m-p/1475927#M28086</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm fairly new to Power BI and DAX and haven't found a solution that fits my current problem. I'd like to calculate the totals for previous week. My date table contains the custom week end&amp;nbsp;column. For example &amp;nbsp;if&amp;nbsp;date 4th November 2020, the custom weekend date is 8/11/2020. I'd like to find out if there's a way to compare to the total from previous week end date depending on the selected date on the filter.&amp;nbsp; If the user selects 28 October 2020, I'd like to find out the total from previous week = 25/10/2020.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or&amp;nbsp;advise will be really appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 07:05:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-Previous-Custom-Week-end-date/m-p/1475927#M28086</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-05T07:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Previous Custom Week end date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-Previous-Custom-Week-end-date/m-p/1476027#M28096</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Assuming you have week start date. &lt;/P&gt;
&lt;P&gt;Refer to my blog to have week start on any date of week if needed - &lt;A href="https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Columns you need in your week/date table(You need to have a date/week Table)&lt;/P&gt;
&lt;P&gt;Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 //Assume you have , this for Monday week &lt;BR /&gt;Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2) //No need option &lt;BR /&gt;Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)&amp;nbsp; //add this on week start date or YYYYWW&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These measures will work &lt;BR /&gt;This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))&lt;BR /&gt;Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))&lt;BR /&gt;Last year Week= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=(max('Date'[Week Rank]) -52)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI — Week on Week and WTD &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 07:59:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-Previous-Custom-Week-end-date/m-p/1476027#M28096</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-11-05T07:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Previous Custom Week end date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-Previous-Custom-Week-end-date/m-p/1477734#M28156</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;that was brilliant! It worked perfectly.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 00:58:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-Previous-Custom-Week-end-date/m-p/1477734#M28156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-06T00:58:34Z</dc:date>
    </item>
  </channel>
</rss>

