<?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: Setting the default date slicer to current year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4009988#M157751</link>
    <description>&lt;P&gt;Here is the general approach for that pattern:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- create a string representation of your date column, replace the latest date with a string "Latest"&lt;BR /&gt;- sort that new column by the original date column&lt;BR /&gt;- add a slicer or visual/page/report level filter&lt;BR /&gt;- set the filter to "Latest"&lt;BR /&gt;- publish the pbix to the workspace/app&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2024 00:40:51 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-06-26T00:40:51Z</dc:date>
    <item>
      <title>Setting the default date slicer to current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4008022#M157178</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a requirement where i have a date slicer as below . These are the min and max values in the dataset. Now my requirement is, when i open the report, the report has to show current year (i.e. 01/01/2024&amp;nbsp; to 31/01/2024) instead of the below values. How can I do that? when I change the relative dates in filter, the user is not allowed to select other years except 2024 . i want user to select other years as well. So can someone suggest how I can do that?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 02:12:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4008022#M157178</guid>
      <dc:creator>jostnachs</dc:creator>
      <dc:date>2024-06-25T02:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the default date slicer to current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4009988#M157751</link>
      <description>&lt;P&gt;Here is the general approach for that pattern:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- create a string representation of your date column, replace the latest date with a string "Latest"&lt;BR /&gt;- sort that new column by the original date column&lt;BR /&gt;- add a slicer or visual/page/report level filter&lt;BR /&gt;- set the filter to "Latest"&lt;BR /&gt;- publish the pbix to the workspace/app&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 00:40:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4009988#M157751</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-26T00:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the default date slicer to current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4010877#M157850</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="759671" data-lia-user-login="jostnachs" class="lia-mention lia-mention-user"&gt;jostnachs&lt;/a&gt;&amp;nbsp;,hello&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Thank you for your prompt reply!&lt;/P&gt;&lt;P&gt;According to your description, you want to &lt;SPAN&gt;“set the default date slicer to current year” and can also filter against all other dates.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Per my test, currently the default slicer cannot do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, we suggest you use the Preselected Slicer from app source as a workaround.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are steps you can refer to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;We get the three point in the "Visualizations", and we click the "Get more visual":&lt;img /&gt;&lt;/LI&gt;&lt;LI&gt;Then we search the "Preselected Slicer" and add the visual to our Power Bi Desktop.&lt;img /&gt;&lt;/LI&gt;&lt;LI&gt;Then, we create a table with one column , and the value is True and False, like this:&lt;img /&gt;&lt;/LI&gt;&lt;LI&gt;Later, we can create a measure to define which the date we need to default preselected. If we need to default preselect then we return True else return False.&lt;/LI&gt;&lt;LI&gt;Flag = var currentYear=YEAR(TODAY())&lt;BR /&gt;VAR _maxcurrentYear=CALCULATE(MAX('Table'[Date]),FILTER('Table',YEAR('Table'[Date])=currentYear))&lt;BR /&gt;var _mincurrentYear=CALCULATE(MIN('Table'[Date]),FILTER('Table',YEAR('Table'[Date])=currentYear))&lt;BR /&gt;var _date = SELECTEDVALUE('Table'[Date])&lt;BR /&gt;return&lt;BR /&gt;IF( _date&amp;lt;= _maxcurrentYear&amp;amp;&amp;amp;_date&amp;gt;=_mincurrentYear,TRUE(),FALSE())&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Lastly, we drag the slicer fields, default selected measure and status column as shown below:&lt;img /&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Note: it&lt;/SPAN&gt;&lt;SPAN&gt;’&lt;/SPAN&gt;&lt;SPAN&gt;s necessary to click the red reset button in the upper right corner to recover the default selections.&lt;/SPAN&gt;&lt;img /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joyce&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 09:11:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4010877#M157850</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-26T09:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the default date slicer to current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4017244#M158380</link>
      <description>&lt;P&gt;Thank you so much for the idea.... But using this particular additional visual is hindering the performance of the report. I tried it. The visual takes a lot of time to load and also its not possible to show it as in between slicer which is what the customer requested for......&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2024 18:14:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4017244#M158380</guid>
      <dc:creator>jostnachs</dc:creator>
      <dc:date>2024-06-30T18:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the default date slicer to current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4021511#M158677</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="759671" data-lia-user-login="jostnachs" class="lia-mention lia-mention-user"&gt;jostnachs&lt;/a&gt;，&lt;/P&gt;
&lt;P&gt;Thank you for your feedback, we recommend send your feature request by submitting your ideas in the following link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://ideas.fabric.microsoft.com/" target="_self"&gt;https://ideas.fabric.microsoft.com/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Joyce&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 01:47:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Setting-the-default-date-slicer-to-current-year/m-p/4021511#M158677</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-03T01:47:12Z</dc:date>
    </item>
  </channel>
</rss>

