<?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: Create a measure to sum this week and divide by last value from last week in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-to-sum-this-week-and-divide-by-last-value-from/m-p/1590504#M31944</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="76761" data-lia-user-login="ashrafkotb" class="lia-mention lia-mention-user"&gt;ashrafkotb&lt;/a&gt; , first if all you need to create a Saturday to Friday Week (Based on date you Said) &lt;/P&gt;
&lt;P&gt;Refer my blog for this - Any Weekday Week - Start From Any day of Week &lt;BR /&gt;&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;Now you have to create a Rank on the Week start date or Week Number and use that, refer to my blog for that&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;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=pnAesWxYgJ8" target="_blank"&gt;https://www.youtube.com/watch?v=pnAesWxYgJ8&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The column you need in the date table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)&lt;/P&gt;
&lt;P&gt;or&lt;BR /&gt;Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYMM format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measures you need&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2021 02:02:23 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-01-12T02:02:23Z</dc:date>
    <item>
      <title>Create a measure to sum this week and divide by last value from last week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-to-sum-this-week-and-divide-by-last-value-from/m-p/1590095#M31927</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a table that looks somehow like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Portfolio Size&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;P/L&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;08/01/2021&lt;/TD&gt;&lt;TD&gt;$100,000&lt;/TD&gt;&lt;TD&gt;$100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11/01/2021&lt;/TD&gt;&lt;TD&gt;$100,100&lt;/TD&gt;&lt;TD&gt;$200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12/01/2021&lt;/TD&gt;&lt;TD&gt;$100,300&lt;/TD&gt;&lt;TD&gt;$300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;13/01/2021&lt;/TD&gt;&lt;TD&gt;$100,600&lt;/TD&gt;&lt;TD&gt;$200&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;08/01/2021 is the last working day of the last week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a measure that will calculate the sum of P/L for the current week and divide by the last "Portfolio Size" value from last week.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 17:32:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-to-sum-this-week-and-divide-by-last-value-from/m-p/1590095#M31927</guid>
      <dc:creator>ashrafkotb</dc:creator>
      <dc:date>2021-01-11T17:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure to sum this week and divide by last value from last week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-to-sum-this-week-and-divide-by-last-value-from/m-p/1590504#M31944</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="76761" data-lia-user-login="ashrafkotb" class="lia-mention lia-mention-user"&gt;ashrafkotb&lt;/a&gt; , first if all you need to create a Saturday to Friday Week (Based on date you Said) &lt;/P&gt;
&lt;P&gt;Refer my blog for this - Any Weekday Week - Start From Any day of Week &lt;BR /&gt;&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;Now you have to create a Rank on the Week start date or Week Number and use that, refer to my blog for that&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;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=pnAesWxYgJ8" target="_blank"&gt;https://www.youtube.com/watch?v=pnAesWxYgJ8&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The column you need in the date table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)&lt;/P&gt;
&lt;P&gt;or&lt;BR /&gt;Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYMM format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measures you need&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 02:02:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-to-sum-this-week-and-divide-by-last-value-from/m-p/1590504#M31944</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-01-12T02:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure to sum this week and divide by last value from last week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-to-sum-this-week-and-divide-by-last-value-from/m-p/1593140#M31965</link>
      <description>&lt;P&gt;Thank you, Amit. The week calculations were very helpful.&amp;nbsp;&lt;BR /&gt;I created all the week columns and they make sense. I'm still not clear about the measure.&lt;BR /&gt;&lt;BR /&gt;The measure I'm looking for should sum the (P/L) column and divide it by the last value of the (Portfolio Size) column from the previous week.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Appreciate if you could help with the correct measure calculation.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 13:34:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-to-sum-this-week-and-divide-by-last-value-from/m-p/1593140#M31965</guid>
      <dc:creator>ashrafkotb</dc:creator>
      <dc:date>2021-01-12T13:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure to sum this week and divide by last value from last week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-to-sum-this-week-and-divide-by-last-value-from/m-p/1594769#M31967</link>
      <description>&lt;P&gt;Using this measure:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Last portfolio = CALCULATE(LASTNONBLANK('tablename'[Portfolio Size],1),FILTER(('tablename'),'tablename'[Week of Year]=MAX('tablename'[Week of Year])-1))&lt;BR /&gt;&lt;BR /&gt;Returns the first value of the portfolio size in the previous week, rather than returning the last value. Any clue how to return the actual last value?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Jan 2021 15:51:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-to-sum-this-week-and-divide-by-last-value-from/m-p/1594769#M31967</guid>
      <dc:creator>ashrafkotb</dc:creator>
      <dc:date>2021-01-12T15:51:08Z</dc:date>
    </item>
  </channel>
</rss>

