<?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: How to Dynamic date period in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Dynamic-date-period/m-p/2603060#M75307</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="404600" data-lia-user-login="tkconsultingnl" class="lia-mention lia-mention-user"&gt;tkconsultingnl&lt;/a&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;May I ask what range of dates the Current Period specifically refers to? I use it as the current month to do the following steps: 1.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Create a new table with all the options you need in the slicer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;2.&amp;nbsp;&lt;SPAN&gt;Turn the single select of the slicer on &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Then create a measure that filters the date period.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =

SWITCH (

    MAX ( 'For Slicer'[Value] ),

    "Current Period", IF ( DATEDIFF ( MAX ( 'Table'[Date] ), TODAY (), MONTH ) = 0, 1, 0 ),

    "Previous Month", IF ( DATEDIFF ( MAX ( 'Table'[Date] ), TODAY (), MONTH ) = 1, 1, 0 ),

    "Previous Quarter",

        VAR currYearQua =

            YEAR ( TODAY () ) * 100

                + QUARTER ( TODAY () )

        VAR yearQua =

            YEAR ( MAX ( 'Table'[Date] ) ) * 100

                + QUARTER ( MAX ( 'Table'[Date] ) )

        RETURN

            IF ( currYearQua - yearQua = 1 || currYearQua - yearQua = 97, 1, 0 ),

    "Previous Year",

        IF ( YEAR ( MAX ( 'Table'[Date] ) ) = YEAR ( TODAY () ) - 1, 1, 0 )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Apply the measure to the visual - level filter , set "is 1":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Final output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If your Current Period does not refer to this, please clarify in a follow-up reply.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Jianbo Li&lt;/P&gt;&lt;P&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 06:55:09 GMT</pubDate>
    <dc:creator>v-jianboli-msft</dc:creator>
    <dc:date>2022-06-27T06:55:09Z</dc:date>
    <item>
      <title>How to Dynamic date period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Dynamic-date-period/m-p/2596909#M74971</link>
      <description>&lt;P&gt;Hi PBI Expert,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with different mesaures,&amp;nbsp; I would like to have year, month, dynamic mesaures created. I have a table with various data, but I don't want to be selecting runperiod manually I would like to automate the year and month to show the following in the table:&lt;/P&gt;&lt;P&gt;1. Current Period&lt;/P&gt;&lt;P&gt;2. Previous Month.&lt;/P&gt;&lt;P&gt;3. Previous quater&lt;/P&gt;&lt;P&gt;4. Previous year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I combine all 4 togther in DAX, that when data is been uploaded when I refreshed the repor it should populate the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in davance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 08:11:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Dynamic-date-period/m-p/2596909#M74971</guid>
      <dc:creator>tkconsultingnl</dc:creator>
      <dc:date>2022-06-23T08:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to Dynamic date period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Dynamic-date-period/m-p/2603060#M75307</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="404600" data-lia-user-login="tkconsultingnl" class="lia-mention lia-mention-user"&gt;tkconsultingnl&lt;/a&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;May I ask what range of dates the Current Period specifically refers to? I use it as the current month to do the following steps: 1.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Create a new table with all the options you need in the slicer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;2.&amp;nbsp;&lt;SPAN&gt;Turn the single select of the slicer on &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Then create a measure that filters the date period.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =

SWITCH (

    MAX ( 'For Slicer'[Value] ),

    "Current Period", IF ( DATEDIFF ( MAX ( 'Table'[Date] ), TODAY (), MONTH ) = 0, 1, 0 ),

    "Previous Month", IF ( DATEDIFF ( MAX ( 'Table'[Date] ), TODAY (), MONTH ) = 1, 1, 0 ),

    "Previous Quarter",

        VAR currYearQua =

            YEAR ( TODAY () ) * 100

                + QUARTER ( TODAY () )

        VAR yearQua =

            YEAR ( MAX ( 'Table'[Date] ) ) * 100

                + QUARTER ( MAX ( 'Table'[Date] ) )

        RETURN

            IF ( currYearQua - yearQua = 1 || currYearQua - yearQua = 97, 1, 0 ),

    "Previous Year",

        IF ( YEAR ( MAX ( 'Table'[Date] ) ) = YEAR ( TODAY () ) - 1, 1, 0 )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Apply the measure to the visual - level filter , set "is 1":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Final output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If your Current Period does not refer to this, please clarify in a follow-up reply.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Jianbo Li&lt;/P&gt;&lt;P&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 06:55:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Dynamic-date-period/m-p/2603060#M75307</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-06-27T06:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Dynamic date period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Dynamic-date-period/m-p/2638360#M77406</link>
      <description>&lt;P&gt;Hi v-jianboili,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your heads up on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current period refers to the actual month the data is availabe, so if May data was loaded and June data not available yet it should still show for the May.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 09:59:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Dynamic-date-period/m-p/2638360#M77406</guid>
      <dc:creator>tkconsultingnl</dc:creator>
      <dc:date>2022-07-14T09:59:42Z</dc:date>
    </item>
  </channel>
</rss>

