<?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: Changing date range filter using a measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Changing-date-range-filter-using-a-measure/m-p/4152432#M165031</link>
    <description>&lt;P&gt;That would be a question for your data model. While you cannot programmatically set slicer boundaries the field that feeds the slicer can be impacted by external filters.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 12:45:38 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-09-16T12:45:38Z</dc:date>
    <item>
      <title>Changing date range filter using a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Changing-date-range-filter-using-a-measure/m-p/4152109#M165003</link>
      <description>&lt;P&gt;Is it possible to change the value of a date range filter using a measure?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have this period filter that is in page1&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;it only affects visuals like table, cards, etc.&lt;BR /&gt;But I don't know if it's possible to change the value of a date range itself.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This date filter is in page2. Hopefully there's a workaround.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 09:08:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Changing-date-range-filter-using-a-measure/m-p/4152109#M165003</guid>
      <dc:creator>dabeans518</dc:creator>
      <dc:date>2024-09-16T09:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Changing date range filter using a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Changing-date-range-filter-using-a-measure/m-p/4152432#M165031</link>
      <description>&lt;P&gt;That would be a question for your data model. While you cannot programmatically set slicer boundaries the field that feeds the slicer can be impacted by external filters.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:45:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Changing-date-range-filter-using-a-measure/m-p/4152432#M165031</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-09-16T12:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Changing date range filter using a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Changing-date-range-filter-using-a-measure/m-p/4153816#M165088</link>
      <description>&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Thanks for the reply from lbendlin&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="798810" data-lia-user-login="dabeans518" class="lia-mention lia-mention-user"&gt;dabeans518&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;You can try using slicer synchronization:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;&lt;SPAN&gt;Firstly, modify the slicer on the page:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;&lt;SPAN&gt;Secondly, create the following measure:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MEASURE =
VAR cc1 =
    MAX ( 'Table'[Column1] )
RETURN
    SWITCH (
        TRUE (),
        cc1 = "YTD", IF ( YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () ), 1, 0 ),
        cc1 = "MTD",
            IF (
                YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () )
                    &amp;amp;&amp;amp; MONTH ( MAX ( 'Table 2'[Date] ) ) = MONTH ( TODAY () ),
                1,
                0
            ),
        FALSE ()
    )
&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;3.&lt;/SPAN&gt;&lt;SPAN&gt;Apply the measure to the slicer:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;4.Here is the final result, which I hope meets your requirements:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;It is recommended to change the slicer style to “tile,” as the current “between” style may cause issues.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;For detailed information, please refer to:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/visuals/enable-sync-slicers" target="_blank"&gt;&lt;SPAN&gt;Enable the Sync Slicers feature in Power BI visuals - Power BI | Microsoft Learn&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Please find the attached pbix relevant to the case.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;SPAN&gt;helps&lt;/SPAN&gt;, then please consider Accept it &lt;SPAN&gt;as the solution &lt;/SPAN&gt;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 06:16:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Changing-date-range-filter-using-a-measure/m-p/4153816#M165088</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-17T06:16:10Z</dc:date>
    </item>
  </channel>
</rss>

