<?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 get default slicer value for second slicer? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-default-slicer-value-for-second-slicer/m-p/3527087#M135526</link>
    <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="640819" data-lia-user-login="AkhilReddyN" class="lia-mention lia-mention-user"&gt;AkhilReddyN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;For the slicer that comes with Power BI, we can not get it. But we can get the three point in the "Visualizations", and we click the "Get more visual":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;First , we need to create a table with one column , and the value is True and False, like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Second, we can create a measure to define that we need default preselection values. If we need default preselection then we return True, otherwise we return False.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
var _select=SELECTEDVALUE('Table'[Column1])
var _step=SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[Column1]=_select),"Column2",'Table'[Column2])
return
SWITCH(
    TRUE(),
    _select="cricket"&amp;amp;&amp;amp;MAX('Table'[Column2])="average",TRUE(),
        ISFILTERED('Table'[Column1])=TRUE()&amp;amp;&amp;amp;MAX('Table'[Column2]) in _step&amp;amp;&amp;amp;_select&amp;lt;&amp;gt;"cricket",TRUE(),         
    ISFILTERED('Table'[Column1]) =FALSE()&amp;amp;&amp;amp;MAX('Table'[Column2]) ="medium",TRUE()
)&lt;/LI-CODE&gt;
&lt;P&gt;Then we can put the 'Table'[Column2] in the Fields , [Measure] in the Pre Selection , 'Dirty Table'[Dirty Status] in the Dirty Status, like below screenshot:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Result:&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2023 07:10:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-11-10T07:10:32Z</dc:date>
    <item>
      <title>How to get default slicer value for second slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-default-slicer-value-for-second-slicer/m-p/3521598#M135275</link>
      <description>&lt;P&gt;Hello Power BI Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a report where cascading filters play a crucial role. My report structure is such that the selection in one slicer dictates the options available in the subsequent slicer.&lt;/P&gt;&lt;P&gt;Here's my scenario:&lt;BR /&gt;1. I have a **&lt;STRONG&gt;Sports&lt;/STRONG&gt;** slicer where users select a cricket, football, batting...&lt;BR /&gt;2. Based on the selected &lt;STRONG&gt;Sports&lt;/STRONG&gt;, a second slicer populates with specific &lt;STRONG&gt;Phase&lt;/STRONG&gt; (e.g., if cricket is chosen, the second slicer may offer &lt;STRONG&gt;average&lt;/STRONG&gt;, &lt;STRONG&gt;medium&lt;/STRONG&gt;, and &lt;STRONG&gt;speed&lt;/STRONG&gt;).&lt;BR /&gt;3. For this second slicer, I want &lt;STRONG&gt;medium&lt;/STRONG&gt;&amp;nbsp;to be selected by default unless the user manually chooses a different &lt;STRONG&gt;sport&lt;/STRONG&gt;.&lt;BR /&gt;4. Further, based on the selection in the second slicer, if i select &lt;STRONG&gt;cricket in slicer1 (sports)&lt;/STRONG&gt; and &lt;STRONG&gt;average is selected on slicer2 (phase)&lt;/STRONG&gt; now if i select &lt;STRONG&gt;batting&lt;/STRONG&gt; it should directly get &lt;STRONG&gt;default as medium&lt;/STRONG&gt; (Note : As &lt;STRONG&gt;batting&lt;/STRONG&gt; only has the &lt;STRONG&gt;medium&lt;/STRONG&gt; field). While I've managed to set up the cascading slicers, my main challenge is setting a default value for the second slicer. Please check the attached images.&amp;nbsp;Is it possible to directly set default slicer values in Power BI? Any guidance or workarounds would be highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below image1 i have selected cricket in slicer1 and average in slicer2&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;In the below image2 i have selected &lt;STRONG&gt;batting&lt;/STRONG&gt;, but here i should get default as &lt;STRONG&gt;medium,&amp;nbsp;&lt;/STRONG&gt;as there is only medium present in batting&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In the image3 there is only medium present in batting column&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;Please find the below PBIX file for reference&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!As-kdGPSpt7ZcPI_jIiiSf1Vckc?e=ANMC1d" target="_blank"&gt;default slicer.pbix&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 07:03:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-default-slicer-value-for-second-slicer/m-p/3521598#M135275</guid>
      <dc:creator>AkhilReddyN</dc:creator>
      <dc:date>2023-11-08T07:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get default slicer value for second slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-default-slicer-value-for-second-slicer/m-p/3521657#M135279</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="640819" data-lia-user-login="AkhilReddyN" class="lia-mention lia-mention-user"&gt;AkhilReddyN&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you should use edit interactions in format tab for making a filter interact the other but as I know there is no way to make automatic selection in slicers (their nature is to be selected by user)&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 07:34:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-default-slicer-value-for-second-slicer/m-p/3521657#M135279</guid>
      <dc:creator>ShirinArshadnia</dc:creator>
      <dc:date>2023-11-08T07:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get default slicer value for second slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-default-slicer-value-for-second-slicer/m-p/3522317#M135304</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543344" data-lia-user-login="ShirinArshadnia" class="lia-mention lia-mention-user"&gt;ShirinArshadnia&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly thanks for your responce, is there any other way&amp;nbsp; possible without using edit interactions. A different way would be helpful in my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 11:52:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-default-slicer-value-for-second-slicer/m-p/3522317#M135304</guid>
      <dc:creator>AkhilReddyN</dc:creator>
      <dc:date>2023-11-08T11:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get default slicer value for second slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-default-slicer-value-for-second-slicer/m-p/3527087#M135526</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="640819" data-lia-user-login="AkhilReddyN" class="lia-mention lia-mention-user"&gt;AkhilReddyN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;For the slicer that comes with Power BI, we can not get it. But we can get the three point in the "Visualizations", and we click the "Get more visual":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;First , we need to create a table with one column , and the value is True and False, like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Second, we can create a measure to define that we need default preselection values. If we need default preselection then we return True, otherwise we return False.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
var _select=SELECTEDVALUE('Table'[Column1])
var _step=SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[Column1]=_select),"Column2",'Table'[Column2])
return
SWITCH(
    TRUE(),
    _select="cricket"&amp;amp;&amp;amp;MAX('Table'[Column2])="average",TRUE(),
        ISFILTERED('Table'[Column1])=TRUE()&amp;amp;&amp;amp;MAX('Table'[Column2]) in _step&amp;amp;&amp;amp;_select&amp;lt;&amp;gt;"cricket",TRUE(),         
    ISFILTERED('Table'[Column1]) =FALSE()&amp;amp;&amp;amp;MAX('Table'[Column2]) ="medium",TRUE()
)&lt;/LI-CODE&gt;
&lt;P&gt;Then we can put the 'Table'[Column2] in the Fields , [Measure] in the Pre Selection , 'Dirty Table'[Dirty Status] in the Dirty Status, like below screenshot:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Result:&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 07:10:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-default-slicer-value-for-second-slicer/m-p/3527087#M135526</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-10T07:10:32Z</dc:date>
    </item>
  </channel>
</rss>

