<?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 set default value for slicer but enabling multiple slicer selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1290109#M22142</link>
    <description>&lt;P&gt;This is the solution I was trying, it does the work too.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;articleDefaultYear = 
var MaxYear = CALCULATE(MAX(Sales[Year]), ALL(Sales))
RETURN

IF(
    not ISFILTERED(Sales[Year]),
        CALCULATE(MIN(Sales[Article]), FILTER(Sales, Sales[Year] = MaxYear)),
        CALCULATE(MIN(Sales[Article]))
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;articleDefaultYear is not blank&lt;/STRONG&gt; must be set as visual-level filter in the table for this to show only the current year data by default (if no year is selected with the slicer) or data from the selected year/years instead.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2020 10:10:48 GMT</pubDate>
    <dc:creator>arielcedola</dc:creator>
    <dc:date>2020-08-12T10:10:48Z</dc:date>
    <item>
      <title>How to set default value for slicer but enabling multiple slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1225020#M19932</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using RANKX to set a default value to a filter in several visuals, as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YearRank = RANKX(ALLSELECTED(Sales[Year]), CALCULATE(MIN(Sales[Year])),,DESC,Dense)&lt;/LI-CODE&gt;&lt;P&gt;I set the current year (top ranked year in the ranking) as the default year in each visual by applying the Top N filter type as follows:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In this way I see only the records for the current year when I come to the report, which is the effect I was looking for. Therefore with the slicer I can easily see the records for the previous years, but if I want to see records for 2 or 3 years together, through a multiple selection in the slicer, obviously using this method it's not possible.&lt;/P&gt;&lt;P&gt;How could I set the by default visualization of the records for the current year, but having still the chance to select multiple years to visualize?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here the link to the pbix file.&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1Z3JizbdKVR4XV98K0zdFopTCAWULumdH/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1Z3JizbdKVR4XV98K0zdFopTCAWULumdH/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 14:46:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1225020#M19932</guid>
      <dc:creator>arielcedola</dc:creator>
      <dc:date>2020-07-15T14:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to set default value for slicer but enabling multiple slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1225061#M19935</link>
      <description>&lt;P&gt;Allow your report users to modify filters, and teach them how to change that particular one.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 14:59:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1225061#M19935</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-15T14:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to set default value for slicer but enabling multiple slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1225338#M19941</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="167219" data-lia-user-login="arielcedola" class="lia-mention lia-mention-user"&gt;arielcedola&lt;/a&gt; , Not sure it will help. But you can have slicer like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a column like this in your date table&lt;/P&gt;
&lt;P&gt;Month Type = Switch( True(),&lt;BR /&gt;year([Date]) = year(Today())-1,"Last Year" ,&lt;BR /&gt;year([Date])= year(Today()),"This Year" ,&lt;BR /&gt;Format([Date],"YYYY")&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you save with "this year", so when you come to the page it will be the latest year.&amp;nbsp; And change it also.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:57:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1225338#M19941</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-15T16:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to set default value for slicer but enabling multiple slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1278477#M21758</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="167219" data-lia-user-login="arielcedola" class="lia-mention lia-mention-user"&gt;arielcedola&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;was your problem solved?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 20:56:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1278477#M21758</guid>
      <dc:creator>mwegener</dc:creator>
      <dc:date>2020-08-06T20:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to set default value for slicer but enabling multiple slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1287153#M22064</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="93408" data-lia-user-login="mwegener" class="lia-mention lia-mention-user"&gt;mwegener&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not yet. In another post&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;suggested me to use ISFILTERED() DAX function to know if the column is being filtered with the slicer. Only when it returns false I should set the default value for the year, it's clear. The point is that I'm not sure how to use this conditional instead of the previously used ranking to filter a table or a viz. Any suggestion?&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 10:30:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1287153#M22064</guid>
      <dc:creator>arielcedola</dc:creator>
      <dc:date>2020-08-11T10:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to set default value for slicer but enabling multiple slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1289461#M22135</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="167219" data-lia-user-login="arielcedola" class="lia-mention lia-mention-user"&gt;arielcedola&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is not easy...&lt;BR /&gt;Check out the solution in the appendix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 06:30:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1289461#M22135</guid>
      <dc:creator>mwegener</dc:creator>
      <dc:date>2020-08-12T06:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to set default value for slicer but enabling multiple slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1289976#M22139</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="93408" data-lia-user-login="mwegener" class="lia-mention lia-mention-user"&gt;mwegener&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it works perfectly, thank you so much. Here your solution:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YearFilter = 
var _MAX_SalesYear = CALCULATE(MAX(Sales[Year]),ALL(Sales))
RETURN
IF(ISFILTERED(Sales[Year]), 1, MAXX(Sales, IF(Sales[Year] = _MAX_SalesYear, 1, BLANK())))&lt;/LI-CODE&gt;&lt;P&gt;Let me ask you something. MAXX function could be replaced without differences in the result for instance by MINX or MEDIANX, is it correct? Why is this function required? If ISFILTERED() is false you need to assign 1's to the rows where Year =&amp;nbsp;_MAX_SalesYear, is this the way?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 09:24:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1289976#M22139</guid>
      <dc:creator>arielcedola</dc:creator>
      <dc:date>2020-08-12T09:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to set default value for slicer but enabling multiple slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1290003#M22140</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="167219" data-lia-user-login="arielcedola" class="lia-mention lia-mention-user"&gt;arielcedola&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use the iterator function to check the rows for the MAX year and to return a 1 accordingly.&lt;BR /&gt;The solution is not perfect, but it works in this scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 09:36:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1290003#M22140</guid>
      <dc:creator>mwegener</dc:creator>
      <dc:date>2020-08-12T09:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to set default value for slicer but enabling multiple slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1290109#M22142</link>
      <description>&lt;P&gt;This is the solution I was trying, it does the work too.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;articleDefaultYear = 
var MaxYear = CALCULATE(MAX(Sales[Year]), ALL(Sales))
RETURN

IF(
    not ISFILTERED(Sales[Year]),
        CALCULATE(MIN(Sales[Article]), FILTER(Sales, Sales[Year] = MaxYear)),
        CALCULATE(MIN(Sales[Article]))
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;articleDefaultYear is not blank&lt;/STRONG&gt; must be set as visual-level filter in the table for this to show only the current year data by default (if no year is selected with the slicer) or data from the selected year/years instead.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 10:10:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-set-default-value-for-slicer-but-enabling-multiple-slicer/m-p/1290109#M22142</guid>
      <dc:creator>arielcedola</dc:creator>
      <dc:date>2020-08-12T10:10:48Z</dc:date>
    </item>
  </channel>
</rss>

