<?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: Handle multiple slicer selections in a visual card with &amp;quot;Multiple options selected&amp;quot; in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2766493#M85936</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;The last part of SWITCH argument is [else] like this:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;SWITCH&lt;SPAN&gt;(&amp;lt;expression&amp;gt;, &amp;lt;&lt;SPAN class=""&gt;value&lt;SPAN&gt;&amp;gt;, &amp;lt;result&amp;gt;[, &amp;lt;value&amp;gt;, &amp;lt;result&amp;gt;]…[, &amp;lt;else&amp;gt;])&lt;BR /&gt;&lt;BR /&gt;Because of this you don't need the counter = 1 part of the dax since If a slicer doesn't have one or multiple values its state is logically no filters. This way we can use the else part of SWITCH.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2022 06:29:54 GMT</pubDate>
    <dc:creator>ValtteriN</dc:creator>
    <dc:date>2022-09-15T06:29:54Z</dc:date>
    <item>
      <title>Handle multiple slicer selections in a visual card with "Multiple options selected"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2763087#M85707</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a visual card that interacts with a slicer, whereby if a user selects one option from the slicer the option will display in a separate visual card. If a user does not select an option the visual card will display "No option selected". Finally, if a user selects multiple options from the slicer the visual card will display the selected options concantenated or if over 3 options are selected the card shall return: "Multiple options selected"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: All slicer options come from the same column within the table (Region).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I have got this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ConcatTest = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _Counter = COUNTROWS(VALUES('Business Unit'[Region]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _Concat = CONCATENATEX(VALUES('Business Unit'[Region]), 'Business Unit'[Region], ", ")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(ISBLANK(SELECTEDVALUE('Business Unit'[Region])), "Please select a region",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_Counter=1, SELECTEDVALUE('Business Unit'[Region]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_Counter&amp;gt;1, _Concat,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_Counter&amp;gt;2, "Multiple regions selected"))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there a means of using if else statements in DAX?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any help is appreciated.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Sep 2022 04:25:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2763087#M85707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T04:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Handle multiple slicer selections in a visual card with "Multiple options selected"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2763385#M85717</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Here is one way to do this kind of state checking:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Slicer state = &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;HASONEFILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (7)'&lt;/SPAN&gt;&lt;SPAN&gt;[Attribute]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"One value selected"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;ISFILTERED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (7)'&lt;/SPAN&gt;&lt;SPAN&gt;[Attribute]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"Multiple values selected"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;"No selection"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Here the SWITCH + TRUE works as iterative if structure, HASONEFILTER check for case where only one filter is applied and ISFILTERED checks for multiple filters. Lastly else for no filters.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Sep 2022 06:54:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2763385#M85717</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-09-13T06:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Handle multiple slicer selections in a visual card with "Multiple options selected"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2763882#M85765</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;BR /&gt;Appreciate your response and it has helped very much.&lt;BR /&gt;Currently I can handle whether multiple regions or one single region/s are selected, but when no regions are selected the card returns the "multiple regions" strings.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;This is the dax:&lt;BR /&gt;&lt;BR /&gt;Testing = &lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;VAR _Counter = COUNTROWS(VALUES('Business Unit'[Region]))&lt;/DIV&gt;&lt;DIV&gt;VAR _Concat = CONCATENATEX(VALUES('Business Unit'[Region]), 'Business Unit'[Region], ", ")&lt;/DIV&gt;&lt;DIV&gt;RETURN&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;SWITCH(TRUE(),&lt;/DIV&gt;&lt;DIV&gt;HASONEFILTER('Business Unit'[Region]), SELECTEDVALUE('Business Unit'[Region]),&lt;/DIV&gt;&lt;DIV&gt;_Counter=2, _Concat,&lt;/DIV&gt;&lt;DIV&gt;_Counter&amp;gt;2, "Multiple regions selected",&lt;/DIV&gt;&lt;DIV&gt;_Counter=1, "Please select a region")&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It seems as if it won't accept the _Counter=1 condition&lt;BR /&gt;&lt;BR /&gt;Any help is appreciated&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Sep 2022 09:32:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2763882#M85765</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T09:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Handle multiple slicer selections in a visual card with "Multiple options selected"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2766493#M85936</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;The last part of SWITCH argument is [else] like this:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;SWITCH&lt;SPAN&gt;(&amp;lt;expression&amp;gt;, &amp;lt;&lt;SPAN class=""&gt;value&lt;SPAN&gt;&amp;gt;, &amp;lt;result&amp;gt;[, &amp;lt;value&amp;gt;, &amp;lt;result&amp;gt;]…[, &amp;lt;else&amp;gt;])&lt;BR /&gt;&lt;BR /&gt;Because of this you don't need the counter = 1 part of the dax since If a slicer doesn't have one or multiple values its state is logically no filters. This way we can use the else part of SWITCH.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 06:29:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2766493#M85936</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-09-15T06:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Handle multiple slicer selections in a visual card with "Multiple options selected"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2853407#M91587</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need your help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a situation here where I need to show multiple values selected from multiple sicers in a card visual.&lt;/P&gt;&lt;P&gt;multiple values of same slicer should be seperated by ","and multiple values from multiple slicers should be seperated by "|".&amp;nbsp;&lt;/P&gt;&lt;P&gt;when no values selected from any of the slicers , it should show "Not Selected"&lt;/P&gt;&lt;P&gt;for example, if I select 2017 and 2018 from Year slicer,&lt;/P&gt;&lt;P&gt;result is : 2017,2018&amp;nbsp; &amp;nbsp;(here "|" is not expecting after the result)&lt;/P&gt;&lt;P&gt;if I select HYD and BZA&amp;nbsp; from LocID slicer and&amp;nbsp; 2021,2022 from year slicer and Azure-C,Azure-F from CourseID,&lt;/P&gt;&lt;P&gt;result is: HYD,BZA | 2021,2022 |Azure-C,Azure-F&lt;/P&gt;&lt;P&gt;If I select no values from three slicers,&lt;/P&gt;&lt;P&gt;Result is: Not Selected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance...&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 10:10:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Handle-multiple-slicer-selections-in-a-visual-card-with-quot/m-p/2853407#M91587</guid>
      <dc:creator>RAJRANJITHBROS</dc:creator>
      <dc:date>2022-10-20T10:10:27Z</dc:date>
    </item>
  </channel>
</rss>

