<?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: Calculate YTD based on an existing Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383988#M25298</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="259991" data-lia-user-login="LeoST" class="lia-mention lia-mention-user"&gt;LeoST&lt;/a&gt; , I tried this on current employee&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = CALCULATE(sumx(SUMMARIZE('Date', 'Date'[Date],"_1",[Current Employees]),[_1]),filter(ALLSELECTED('Date'),'Date'[Date] &amp;lt;=max('Date'[Date])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you might have to use month year&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = CALCULATE(sumx(SUMMARIZE('Date', 'Date'[Month Year],"_1",[Current Employees]),[_1]),filter(ALLSELECTED('Date'),'Date'[Date] &amp;lt;=max('Date'[Date])))&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 21 Sep 2020 09:57:31 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-09-21T09:57:31Z</dc:date>
    <item>
      <title>Calculate YTD based on an existing Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383397#M25282</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;my table looks like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Cost&lt;/TD&gt;&lt;TD&gt;Start&lt;/TD&gt;&lt;TD&gt;End&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;01.05.2020&lt;/TD&gt;&lt;TD&gt;31.12.2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;01.02.2020&lt;/TD&gt;&lt;TD&gt;31.11.2021&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I've created a measure that shows me the costs per month for each month already:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Cost Monthly = 
CALCULATE(
	SUM('DataTable'[Cost]), 
    FILTER(
        ALLSELECTED(DataTable), 
        (DataTable[Start].[Date] &amp;lt;= MAX(DataTable[Start].[Date]) &amp;amp;&amp;amp; ((DataTable[End].[Date] &amp;gt;= MAX(DataTable[Start].[Date])) || (ISBLANK(DataTable[End].[Date]) ))
    )
))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works fine when I use the Start Column as a axis and shows me the sum of all costs for each month.&lt;/P&gt;&lt;P&gt;However I can't get the total cost for a year because the YTD function based on my Measure "Total Cost Monthly" and the start date. This calculates almost the same values as my "Total Cost Monthly" measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any trick to get the YTD working or any other way to calculate the yearly values?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 07:28:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383397#M25282</guid>
      <dc:creator>LeoST</dc:creator>
      <dc:date>2020-09-21T07:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD based on an existing Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383720#M25286</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="259991" data-lia-user-login="LeoST" class="lia-mention lia-mention-user"&gt;LeoST&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;Can you share 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;Refer if these can help&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;or this file&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/s/bqbei7b8qbq5xez/leavebetweendates.pbix?dl=0" target="_blank"&gt;https://www.dropbox.com/s/bqbei7b8qbq5xez/leavebetweendates.pbix?dl=0&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 08:58:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383720#M25286</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-09-21T08:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD based on an existing Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383774#M25291</link>
      <description>Yeah, there is a trick. It'll all be working fine if you start building correct models and use dedicated Date tables instead of the automatic ones. Automatic date tables are only for the simplest of models and should be avoided in professional development like the plague.</description>
      <pubDate>Mon, 21 Sep 2020 09:15:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383774#M25291</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-21T09:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD based on an existing Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383950#M25297</link>
      <description>&lt;P&gt;Hello&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;Thanks for your quick response and the link - it was very helpful!&lt;/P&gt;&lt;P&gt;My datamodel now looks almost identical as your HR example. The formula for "Current Employees" also works perfectly for me except that I need the sum and not count since I calculate with costs and not employees. So that gives me reliably the total costs per month for each month individually.&lt;/P&gt;&lt;P&gt;Now what I try to do is something like a running total over that adopted "Current Employees" measure (doesn't make any sence&amp;nbsp;for employee counts but in my case with costs it does and gives me the total costs in that year that).&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; So in July 20 I've -136 Cost and in May 21 I've -140 Cost. My measure should show me know the total cost for a year like 2020 or 2021 (so I need to sum up the values again).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 09:49:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383950#M25297</guid>
      <dc:creator>LeoST</dc:creator>
      <dc:date>2020-09-21T09:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD based on an existing Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383988#M25298</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="259991" data-lia-user-login="LeoST" class="lia-mention lia-mention-user"&gt;LeoST&lt;/a&gt; , I tried this on current employee&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = CALCULATE(sumx(SUMMARIZE('Date', 'Date'[Date],"_1",[Current Employees]),[_1]),filter(ALLSELECTED('Date'),'Date'[Date] &amp;lt;=max('Date'[Date])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you might have to use month year&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = CALCULATE(sumx(SUMMARIZE('Date', 'Date'[Month Year],"_1",[Current Employees]),[_1]),filter(ALLSELECTED('Date'),'Date'[Date] &amp;lt;=max('Date'[Date])))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Sep 2020 09:57:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1383988#M25298</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-09-21T09:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD based on an existing Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1384246#M25299</link>
      <description>&lt;P class="lia-align-left"&gt;Thanks a lot, that works perfectly!&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;I think I understood now how to handle dates in Power BI in the right way - thanks for that!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 11:07:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-based-on-an-existing-Measure/m-p/1384246#M25299</guid>
      <dc:creator>LeoST</dc:creator>
      <dc:date>2020-09-21T11:07:37Z</dc:date>
    </item>
  </channel>
</rss>

