<?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: Last YTD calculation non standard date table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1610075#M32355</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="258181" data-lia-user-login="Nurry90" class="lia-mention lia-mention-user"&gt;Nurry90&lt;/a&gt;&amp;nbsp;,&amp;nbsp;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have Year (FY) and Week&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then year week&amp;nbsp; Rank should also work&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Year Week&amp;nbsp; =[Year]*100 + [Week]&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Year Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //option , you can use year of year start date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;</description>
    <pubDate>Wed, 20 Jan 2021 03:19:08 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-01-20T03:19:08Z</dc:date>
    <item>
      <title>Last YTD calculation non standard date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1607055#M32262</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to do two things in one;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 - Create a calculation for last year to date total ( I have used the below calculation, but it is not giving me totals)&lt;/P&gt;&lt;P&gt;2 - Within my calculation, I would like it to be used within different contexts/filters. I.E. I want to be able to use the same calculation in a table with Month in Year (e.g May - FY2020) and within a table with week and year (e.g wk 52 - FY2020).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a non-standard date table so cannot use the built in YTD functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LYTD = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Currentmonth = SELECTEDVALUE('Date Table'[Fiscal Month])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Currentweek = SELECTEDVALUE('Date Table'[FY Week number])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentYear = SELECTEDVALUE('Date Table'[Fin Yr])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Current Sales],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(ALL('Date Table'),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Date Table'[FY Week number] = Currentweek &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Date Table'[Fiscal Month] = Currentmonth &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Date Table'[Fin Yr] = CurrentYear - 1))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Jan 2021 01:47:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1607055#M32262</guid>
      <dc:creator>Nurry90</dc:creator>
      <dc:date>2021-01-19T01:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Last YTD calculation non standard date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1607130#M32265</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="258181" data-lia-user-login="Nurry90" class="lia-mention lia-mention-user"&gt;Nurry90&lt;/a&gt; , In case you have year start date you can get this easily using a calendar table &lt;/P&gt;
&lt;P&gt;New columns&lt;/P&gt;
&lt;P&gt;Year Rank = RANKX(all('Date'),'Date'[Year Start date],,ASC,Dense) //option , you can use year of year start date &lt;/P&gt;
&lt;P&gt;Year Week = [Year]*100 +[Week]&lt;/P&gt;
&lt;P&gt;Day of Year =datediff([Year Start date] , [Date],Day) +1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try measures like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;BR /&gt;Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;BR /&gt;rolling = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]&amp;gt;=max('Date'[Year])-2 &amp;amp;&amp;amp; 'Date'[Year]&amp;lt;=max('Date'[Year])) )&lt;/P&gt;
&lt;P&gt;diff = [This Year]-[Last Year ]&lt;BR /&gt;diff % = divide([This Year]-[Last Year ],[Last Year ])&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This Year = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])))&lt;BR /&gt;Last Year = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank]) &amp;amp;&amp;amp; 'Date'[Day of Year] &amp;lt;= Max('Date'[Day of Year]) ))&lt;BR /&gt;LYTD = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1 &amp;amp;&amp;amp; 'Date'[Day of Year] &amp;lt;= Max('Date'[Day of Year])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) &amp;amp;&amp;amp; 'Date'[Month] &amp;lt;= Max('Date'[Month]) ))&lt;BR /&gt;LYTD = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 &amp;amp;&amp;amp; 'Date'[Month] &amp;lt;= Max('Date'[Month])))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) &amp;amp;&amp;amp; 'Date'[Week] &amp;lt;= Max('Date'[Week]) ))&lt;BR /&gt;LYTD = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 &amp;amp;&amp;amp; 'Date'[Week] &amp;lt;= Max('Date'[Week])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI — Year on Year with or Without Time Intelligence &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=km41KfM_0uA" target="_blank"&gt;https://www.youtube.com/watch?v=km41KfM_0uA&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.Creating Financial Calendar - From Any Month &lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calendar-1-5-Power/ba-p/1187441" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calendar-1-5-Power/ba-p/1187441&lt;/A&gt;&lt;BR /&gt;2.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;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 02:27:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1607130#M32265</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-01-19T02:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Last YTD calculation non standard date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1607131#M32266</link>
      <description>&lt;P&gt;Your filters would only calculate the sales for the same monthweek* of last year, but not the Last Year To Date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* - that monthweek is a mythical being, you cannot guarantee that the same month last year had the same week numbers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to calculate an actual LastYTD then what you need is to add a calculated column to your dates table that flags all days smaller than "TODAY() minus one year" as valid (true), and then add that filter to the SAMEPERIODLASTYEAR() call.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 02:27:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1607131#M32266</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-01-19T02:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Last YTD calculation non standard date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1610059#M32352</link>
      <description>&lt;P&gt;Hi&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;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not have a set start date for fiscal year. The data that I am working off is weekly data that comes in. Week 1 is not the same start date each year so i am not sure these would work.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 03:08:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1610059#M32352</guid>
      <dc:creator>Nurry90</dc:creator>
      <dc:date>2021-01-20T03:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Last YTD calculation non standard date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1610063#M32353</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would not have the calculation on the same table, I just want to use the same calculation in both scenarios. Is it possible to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 03:11:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1610063#M32353</guid>
      <dc:creator>Nurry90</dc:creator>
      <dc:date>2021-01-20T03:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Last YTD calculation non standard date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1610075#M32355</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="258181" data-lia-user-login="Nurry90" class="lia-mention lia-mention-user"&gt;Nurry90&lt;/a&gt;&amp;nbsp;,&amp;nbsp;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have Year (FY) and Week&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then year week&amp;nbsp; Rank should also work&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Year Week&amp;nbsp; =[Year]*100 + [Week]&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Year Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //option , you can use year of year start date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;</description>
      <pubDate>Wed, 20 Jan 2021 03:19:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-YTD-calculation-non-standard-date-table/m-p/1610075#M32355</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-01-20T03:19:08Z</dc:date>
    </item>
  </channel>
</rss>

