<?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: Apply time period to IF measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-time-period-to-IF-measure/m-p/2822495#M89620</link>
    <description>&lt;P&gt;You should ditch your IF's in favour of SWITCH. Second, creating a 'static' measure is simple - use the right filters on your existing measures.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 10:50:51 GMT</pubDate>
    <dc:creator>daXtreme</dc:creator>
    <dc:date>2022-10-06T10:50:51Z</dc:date>
    <item>
      <title>Apply time period to IF measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-time-period-to-IF-measure/m-p/2821723#M89584</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have an exisitng measure that works well - it is based on a number of "IF" statement and in the end calculates the accuracy of a forecast.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;Forecast accuracy Consensus = &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Region consolidated data'&lt;/SPAN&gt;&lt;SPAN&gt;[Total demand]&lt;/SPAN&gt;&lt;SPAN&gt;)=&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Region consolidated data'&lt;/SPAN&gt;&lt;SPAN&gt;[ABS deviation consensus]&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; SUM('Region consolidated data'[ABS deviation consensus]),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; SUM('Region consolidated data'[Total demand])&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&amp;lt;0,0,1-divide(sum('Region consolidated data'[ABS deviation consensus]),sum('Region consolidated data'[Total demand]))))&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can filter the data to only show the last 3 months, 6 months etc. through the date slicer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I would also like to have a "static" measure for the last 3 month, 6 months and 12 months to be able to show these side by side in a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone advise on how I can create "new" measures based on above but limited to the mentioned time periods?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 06:46:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-time-period-to-IF-measure/m-p/2821723#M89584</guid>
      <dc:creator>KMadsen</dc:creator>
      <dc:date>2022-10-06T06:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Apply time period to IF measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-time-period-to-IF-measure/m-p/2822348#M89608</link>
      <description>&lt;P&gt;You could create a calculation group with calculation items for each period you want to show, e.g.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;3 months =
VAR StartDate =
    EOMONTH ( TODAY (), -4 ) + 1
RETURN
    CALCULATE (
        SELECTEDMEASURE (),
        'Date'[Date] &amp;gt;= StartDate
            &amp;amp;&amp;amp; 'Date'[Date] &amp;lt;= TODAY ()
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Oct 2022 09:59:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-time-period-to-IF-measure/m-p/2822348#M89608</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-10-06T09:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Apply time period to IF measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-time-period-to-IF-measure/m-p/2822495#M89620</link>
      <description>&lt;P&gt;You should ditch your IF's in favour of SWITCH. Second, creating a 'static' measure is simple - use the right filters on your existing measures.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 10:50:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-time-period-to-IF-measure/m-p/2822495#M89620</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-10-06T10:50:51Z</dc:date>
    </item>
  </channel>
</rss>

