<?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: Calculated column for summing last years margin to date, against the organisation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-for-summing-last-years-margin-to-date-against/m-p/1329328#M23521</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;Thank you for your reply. Sorry I should have mentioned I am unable to use a date table for this column. Basically our 'scheme month' runs from different days of the month. For example: the 28th to the 27th of the following month. The dates can change from month to month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each order has the scheme month against it, for example all orders between July the 28th and August the 27th will have the scheme month of 01/08/2020 against it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Roger&lt;/P&gt;</description>
    <pubDate>Thu, 27 Aug 2020 14:43:00 GMT</pubDate>
    <dc:creator>Rogerh</dc:creator>
    <dc:date>2020-08-27T14:43:00Z</dc:date>
    <item>
      <title>Calculated column for summing last years margin to date, against the organisation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-for-summing-last-years-margin-to-date-against/m-p/1326263#M23393</link>
      <description>&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a table of our customers using Calculated Columns and have been adding additional calculated columns to it so I can easily write IF statements based on the results. All has been fine except for trying to create a column on Margin, same period last year, to date for 2019.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code works fine for this year:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Year to Date Margin = &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;SUM('Platform - Orders'[New Margin]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER ( ALL ( 'Platform - Orders' ), 'Platform - Orders'[organisation_id] = 'Platform - Scorecard'[organisation_id] &amp;amp;&amp;amp; 'Platform - Orders'[Scheme Month] &amp;gt;= DATE(2020, 1, 1)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Just to mention I use the Organisation ID to match the custom table and the 'Platform - orders' table.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I used the same logic as above for 2019, the code didn't error but it returns nothing.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2019 YTD Margin = &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;SUM('Platform - Orders'[New Margin]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER ( ALL ( 'Platform - Orders' ), 'Platform - Orders'[organisation_id] = 'Platform - Scorecard'[organisation_id] &amp;amp;&amp;amp; 'Platform - Orders'[Scheme Month] &amp;gt;= DATE(2019,01,01) &amp;amp;&amp;amp; 'Platform - Orders'[Scheme Month] &amp;lt;= DATE(2019,08,01)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked into it and Dates between came up a lot so I gave that a go in multiple ways, with no results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2019 YTD Margin = &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;SUM('Platform - Orders'[New Margin]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER ( ALL ( 'Platform - Orders' ), 'Platform - Orders'[organisation_id] = 'Platform - Scorecard'[organisation_id] &amp;amp;&amp;amp; DATESBETWEEN('Platform - Orders'[Scheme Month] , DATE(2019,01,01) , DATE(2019,08,01))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Ideally I would like this to be automated so each month I dont have to update the date but I do not know how to do this. Can I please have some assistance with the code and / or guidence on the best way of doing it?&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Roger&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 26 Aug 2020 15:00:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-for-summing-last-years-margin-to-date-against/m-p/1326263#M23393</guid>
      <dc:creator>Rogerh</dc:creator>
      <dc:date>2020-08-26T15:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column for summing last years margin to date, against the organisation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-for-summing-last-years-margin-to-date-against/m-p/1326422#M23406</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240346" data-lia-user-login="Rogerh" class="lia-mention lia-mention-user"&gt;Rogerh&lt;/a&gt; , Try with a date table &lt;/P&gt;
&lt;P&gt;measure = &lt;BR /&gt;var _max = maxx(allselected(Date),Date[Date]) // or use today &lt;BR /&gt;var _min = date(year(_max)-1,1,1)&lt;BR /&gt;return&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM('Platform - Orders'[New Margin]),filter(all(Date), Date[Date]&amp;gt;=_min &amp;amp;&amp;amp; Date[Date]&amp;lt;=_min))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;BR /&gt;&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions&lt;/A&gt; &lt;BR /&gt;&lt;A href="https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi" target="_blank"&gt;https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Power BI — YTD &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;Power BI — QTD &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839&lt;/A&gt;&lt;BR /&gt;Power BI — MTD &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;See if my webinar on Time Intelligence can help: &lt;A href="https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184" target="_blank"&gt;https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Appreciate your Kudos.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 16:05:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-for-summing-last-years-margin-to-date-against/m-p/1326422#M23406</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-26T16:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column for summing last years margin to date, against the organisation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-for-summing-last-years-margin-to-date-against/m-p/1329328#M23521</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;Thank you for your reply. Sorry I should have mentioned I am unable to use a date table for this column. Basically our 'scheme month' runs from different days of the month. For example: the 28th to the 27th of the following month. The dates can change from month to month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each order has the scheme month against it, for example all orders between July the 28th and August the 27th will have the scheme month of 01/08/2020 against it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Roger&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 14:43:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-for-summing-last-years-margin-to-date-against/m-p/1329328#M23521</guid>
      <dc:creator>Rogerh</dc:creator>
      <dc:date>2020-08-27T14:43:00Z</dc:date>
    </item>
  </channel>
</rss>

