<?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: crear medida con calculate y datesYTD que no se afecte con otros filtros in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/crear-medida-con-calculate-y-datesYTD-que-no-se-afecte-con-otros/m-p/1509577#M29314</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="261282" data-lia-user-login="JoseOrlando" class="lia-mention lia-mention-user"&gt;JoseOrlando&lt;/a&gt; , Create these two column in your date table &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on Today &lt;BR /&gt;Year Start date = startofyear([Date],"12/31") // give year end date of your choice &lt;BR /&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;And try measure like&lt;/P&gt;
&lt;P&gt;YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] =year(Today()) &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] = year(Today())-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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD= &lt;BR /&gt;var _min = date(year(today()),1,1)&lt;BR /&gt;var _day = datediff(_min, today(),day)+1&lt;BR /&gt;return &lt;BR /&gt;CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] =year(Today()) &amp;amp;&amp;amp; 'Date'[Day of Year] &amp;lt;= _day) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LYTD = &lt;BR /&gt;var _min = date(year(today())-1,1,1)&lt;BR /&gt;var _max = date(year(today())-1,month(today()),day(today()))&lt;BR /&gt;var _day = datediff(_min, _max,day)+1&lt;BR /&gt;return &lt;BR /&gt;CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] = year(Today())-1 &amp;amp;&amp;amp; 'Date'[Day of Year] &amp;lt;= _day))&lt;/P&gt;</description>
    <pubDate>Mon, 23 Nov 2020 01:33:15 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-11-23T01:33:15Z</dc:date>
    <item>
      <title>crear medida con calculate y datesYTD que no se afecte con otros filtros</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/crear-medida-con-calculate-y-datesYTD-que-no-se-afecte-con-otros/m-p/1509538#M29313</link>
      <description>&lt;P&gt;como se puede crear una medida con calculate y filtro de fechas (datesytd), pero que no se vea afectada por otros filtros de la pagina (año por ejemplo)&lt;/P&gt;&lt;P&gt;es decir, que la medida siempre me de las ventas del año actual, sin importar los filtros de la pagina&lt;/P&gt;&lt;P&gt;gracias por su ayuda&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 00:59:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/crear-medida-con-calculate-y-datesYTD-que-no-se-afecte-con-otros/m-p/1509538#M29313</guid>
      <dc:creator>JoseOrlando</dc:creator>
      <dc:date>2020-11-23T00:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: crear medida con calculate y datesYTD que no se afecte con otros filtros</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/crear-medida-con-calculate-y-datesYTD-que-no-se-afecte-con-otros/m-p/1509577#M29314</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="261282" data-lia-user-login="JoseOrlando" class="lia-mention lia-mention-user"&gt;JoseOrlando&lt;/a&gt; , Create these two column in your date table &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on Today &lt;BR /&gt;Year Start date = startofyear([Date],"12/31") // give year end date of your choice &lt;BR /&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;And try measure like&lt;/P&gt;
&lt;P&gt;YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] =year(Today()) &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] = year(Today())-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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD= &lt;BR /&gt;var _min = date(year(today()),1,1)&lt;BR /&gt;var _day = datediff(_min, today(),day)+1&lt;BR /&gt;return &lt;BR /&gt;CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] =year(Today()) &amp;amp;&amp;amp; 'Date'[Day of Year] &amp;lt;= _day) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LYTD = &lt;BR /&gt;var _min = date(year(today())-1,1,1)&lt;BR /&gt;var _max = date(year(today())-1,month(today()),day(today()))&lt;BR /&gt;var _day = datediff(_min, _max,day)+1&lt;BR /&gt;return &lt;BR /&gt;CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] = year(Today())-1 &amp;amp;&amp;amp; 'Date'[Day of Year] &amp;lt;= _day))&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 01:33:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/crear-medida-con-calculate-y-datesYTD-que-no-se-afecte-con-otros/m-p/1509577#M29314</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-11-23T01:33:15Z</dc:date>
    </item>
  </channel>
</rss>

