<?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: Formula adapt to current year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-adapt-to-current-year/m-p/2554278#M72425</link>
    <description>&lt;P&gt;Hi&amp;nbsp; Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 =
CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure_today =
var _select=SELECTEDVALUE('Table 2'[Year])
return
IF(
    _select = YEAR(TODAY()),
CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Date]&amp;gt;=DATE(2020,1,1)&amp;amp;&amp;amp;'Table'[Date]&amp;lt;=TODAY()&amp;amp;&amp;amp;'Table'[afdeling] in {"BPM","Asfalt"})))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure_Month =
var _select=SELECTEDVALUE('Table 2'[Year])
return
IF(
    _select = YEAR(TODAY()),
CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Date]&amp;gt;=DATE(2020,1,1)&amp;amp;&amp;amp;'Table'[Date]&amp;lt;=EOMONTH(TODAY(),0)&amp;amp;&amp;amp;'Table'[afdeling] in {"BPM","Asfalt"})))&lt;/LI-CODE&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2022 05:45:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-06-02T05:45:54Z</dc:date>
    <item>
      <title>Formula adapt to current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-adapt-to-current-year/m-p/2547819#M72005</link>
      <description>&lt;P&gt;Hey Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help with the following formula:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Toolbox vereist 2 = CALCULATE(IF( YEAR (MAX(Datum[Datum]))= YEAR( NOW()),&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;10/12 * ((CALCULATE(DISTINCTCOUNT(Datum[Maand]), personen[afdeling] = "BPM" || personen[afdeling] = "Asfalt" )) *&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Calculate(DISTINCTCOUNT(Personen[Naam]), personen[afdeling] = "BPM" || personen[afdeling] = "Asfalt" )) * &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;[Huidige dag vh jaar] / 356,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;10/12 * ((CALCULATE(DISTINCTCOUNT(Datum[Maand]), personen[afdeling] = "BPM" || personen[afdeling] = "Asfalt" )) *&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Calculate(DISTINCTCOUNT(Personen[Naam]), personen[afdeling] = "BPM" || personen[afdeling] = "Asfalt" ))), &lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;Datum[Datum] &amp;gt; DATE(2020,1,1), Datum[Datum] &amp;lt; DATE(YEAR(TODAY())+1,1,1)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is it possible to make the formula that if i select the current year, that it really shows me the value up untill today (or this month)?&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 May 2022 12:37:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-adapt-to-current-year/m-p/2547819#M72005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-30T12:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Formula adapt to current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-adapt-to-current-year/m-p/2547873#M72007</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , &lt;/P&gt;
&lt;P&gt;New Measure&amp;nbsp; =&lt;/P&gt;
&lt;P&gt;var _fil = if( year(selectedvalue(Datum[Datum])), Year(Today()) , filter(Datum, Datum[Datum] &amp;lt;= Today()) ,filter(Datum, Datum[Datum] = selectedvalue(Datum[Datum])) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;calculate([Measure], _fil )&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 12:58:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-adapt-to-current-year/m-p/2547873#M72007</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-05-30T12:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Formula adapt to current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-adapt-to-current-year/m-p/2554278#M72425</link>
      <description>&lt;P&gt;Hi&amp;nbsp; Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 =
CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure_today =
var _select=SELECTEDVALUE('Table 2'[Year])
return
IF(
    _select = YEAR(TODAY()),
CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Date]&amp;gt;=DATE(2020,1,1)&amp;amp;&amp;amp;'Table'[Date]&amp;lt;=TODAY()&amp;amp;&amp;amp;'Table'[afdeling] in {"BPM","Asfalt"})))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure_Month =
var _select=SELECTEDVALUE('Table 2'[Year])
return
IF(
    _select = YEAR(TODAY()),
CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Date]&amp;gt;=DATE(2020,1,1)&amp;amp;&amp;amp;'Table'[Date]&amp;lt;=EOMONTH(TODAY(),0)&amp;amp;&amp;amp;'Table'[afdeling] in {"BPM","Asfalt"})))&lt;/LI-CODE&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 05:45:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-adapt-to-current-year/m-p/2554278#M72425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-02T05:45:54Z</dc:date>
    </item>
  </channel>
</rss>

