<?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 Hiding visual when multiple slicers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hiding-visual-when-multiple-slicers/m-p/3350784#M125816</link>
    <description>&lt;P class=""&gt;Morning all,&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I'm hoping there's someone out there that can help me as my brain is melting a bit!!&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I have two tabs in power bi, on one tab I manage to hide my table in the report view using the following calculation when a selection is not made on the T_code slicer:&lt;/P&gt;&lt;P class=""&gt;VisualFilterAll = IF(ISFILTERED(Grouped[T_Code]),1,0)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;On the second tab I have two slicers, so I have tried to do the following:&lt;/P&gt;&lt;P class=""&gt;VisualPeopleHideCol = IF(OR(&lt;/P&gt;&lt;P class=""&gt;ISFILTERED(Grouped[MasterEmployeeName]),ISFILTERED(tbl_Base_KeyDetails[Sub_Capability])),&lt;/P&gt;&lt;P class=""&gt;1,&lt;/P&gt;&lt;P class=""&gt;0&lt;/P&gt;&lt;P class=""&gt;)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;That didn’t work so I had a look to see whether it was an issue with the Grouped[MasterEmployeeName] or tbl_Base_KeyDetails[Sub_Capability]&lt;/P&gt;&lt;P class=""&gt;I created:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Test 1 = IF(ISFILTERED(tbl_Base_KeyDetails[Sub_Capability]),1,0) – this would hide the table in the visual when the sub capability slicer wasn’t selected from the slicer and show the table when the sub capability slicer was selected&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Test 2 = IF(ISFILTERED(Grouped[MasterEmployeeName]),1,0) – the table remained shown whether the MasterEmployeeName Slicer was selected or not&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;This to note but I’m not sure whether this affects it or not:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the sub_capability and MasterEmployeeName columns are text values&lt;/LI&gt;&lt;LI&gt;There is a relationship between both tables&lt;/LI&gt;&lt;LI&gt;The MasterEmployeeName column is a calculated column made up of the following calculation to improve the data quality between the merging of the datasets:&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;MasterEmployeeName =&lt;/P&gt;&lt;P class=""&gt;IF (&lt;/P&gt;&lt;P class=""&gt;NOT ( ISBLANK ( 'Grouped'[FullName] ) ),&lt;/P&gt;&lt;P class=""&gt;'Grouped'[FullName],&lt;/P&gt;&lt;P class=""&gt;IF (&lt;/P&gt;&lt;P class=""&gt;ISBLANK ( 'Grouped'[FullName] ) &amp;amp;&amp;amp;&lt;/P&gt;&lt;P class=""&gt;NOT ( ISBLANK ( 'Grouped'[MasterEmployeeNumber] ) ) &amp;amp;&amp;amp;&lt;/P&gt;&lt;P class=""&gt;NOT ( ISBLANK ( 'Grouped'[Resource Name] ) ),&lt;/P&gt;&lt;P class=""&gt;VAR MasterEmployeeNumber =&lt;/P&gt;&lt;P class=""&gt;CALCULATE(&lt;/P&gt;&lt;P class=""&gt;MAX ( 'Grouped'[MasterEmployeeNumber] ),&lt;/P&gt;&lt;P class=""&gt;ALLEXCEPT( 'Grouped', 'Grouped'[Resource Name] )&lt;/P&gt;&lt;P class=""&gt;)&lt;/P&gt;&lt;P class=""&gt;RETURN&lt;/P&gt;&lt;P class=""&gt;IF (&lt;/P&gt;&lt;P class=""&gt;'Grouped'[MasterEmployeeNumber] = MasterEmployeeNumber,&lt;/P&gt;&lt;P class=""&gt;'Grouped'[Resource Name],&lt;/P&gt;&lt;P class=""&gt;BLANK()&lt;/P&gt;&lt;P class=""&gt;),&lt;/P&gt;&lt;P class=""&gt;BLANK ()&lt;/P&gt;&lt;P class=""&gt;)&lt;/P&gt;&lt;P class=""&gt;)&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2023 10:33:32 GMT</pubDate>
    <dc:creator>YellowSquirrel</dc:creator>
    <dc:date>2023-07-26T10:33:32Z</dc:date>
    <item>
      <title>Hiding visual when multiple slicers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hiding-visual-when-multiple-slicers/m-p/3350784#M125816</link>
      <description>&lt;P class=""&gt;Morning all,&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I'm hoping there's someone out there that can help me as my brain is melting a bit!!&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I have two tabs in power bi, on one tab I manage to hide my table in the report view using the following calculation when a selection is not made on the T_code slicer:&lt;/P&gt;&lt;P class=""&gt;VisualFilterAll = IF(ISFILTERED(Grouped[T_Code]),1,0)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;On the second tab I have two slicers, so I have tried to do the following:&lt;/P&gt;&lt;P class=""&gt;VisualPeopleHideCol = IF(OR(&lt;/P&gt;&lt;P class=""&gt;ISFILTERED(Grouped[MasterEmployeeName]),ISFILTERED(tbl_Base_KeyDetails[Sub_Capability])),&lt;/P&gt;&lt;P class=""&gt;1,&lt;/P&gt;&lt;P class=""&gt;0&lt;/P&gt;&lt;P class=""&gt;)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;That didn’t work so I had a look to see whether it was an issue with the Grouped[MasterEmployeeName] or tbl_Base_KeyDetails[Sub_Capability]&lt;/P&gt;&lt;P class=""&gt;I created:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Test 1 = IF(ISFILTERED(tbl_Base_KeyDetails[Sub_Capability]),1,0) – this would hide the table in the visual when the sub capability slicer wasn’t selected from the slicer and show the table when the sub capability slicer was selected&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Test 2 = IF(ISFILTERED(Grouped[MasterEmployeeName]),1,0) – the table remained shown whether the MasterEmployeeName Slicer was selected or not&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;This to note but I’m not sure whether this affects it or not:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the sub_capability and MasterEmployeeName columns are text values&lt;/LI&gt;&lt;LI&gt;There is a relationship between both tables&lt;/LI&gt;&lt;LI&gt;The MasterEmployeeName column is a calculated column made up of the following calculation to improve the data quality between the merging of the datasets:&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;MasterEmployeeName =&lt;/P&gt;&lt;P class=""&gt;IF (&lt;/P&gt;&lt;P class=""&gt;NOT ( ISBLANK ( 'Grouped'[FullName] ) ),&lt;/P&gt;&lt;P class=""&gt;'Grouped'[FullName],&lt;/P&gt;&lt;P class=""&gt;IF (&lt;/P&gt;&lt;P class=""&gt;ISBLANK ( 'Grouped'[FullName] ) &amp;amp;&amp;amp;&lt;/P&gt;&lt;P class=""&gt;NOT ( ISBLANK ( 'Grouped'[MasterEmployeeNumber] ) ) &amp;amp;&amp;amp;&lt;/P&gt;&lt;P class=""&gt;NOT ( ISBLANK ( 'Grouped'[Resource Name] ) ),&lt;/P&gt;&lt;P class=""&gt;VAR MasterEmployeeNumber =&lt;/P&gt;&lt;P class=""&gt;CALCULATE(&lt;/P&gt;&lt;P class=""&gt;MAX ( 'Grouped'[MasterEmployeeNumber] ),&lt;/P&gt;&lt;P class=""&gt;ALLEXCEPT( 'Grouped', 'Grouped'[Resource Name] )&lt;/P&gt;&lt;P class=""&gt;)&lt;/P&gt;&lt;P class=""&gt;RETURN&lt;/P&gt;&lt;P class=""&gt;IF (&lt;/P&gt;&lt;P class=""&gt;'Grouped'[MasterEmployeeNumber] = MasterEmployeeNumber,&lt;/P&gt;&lt;P class=""&gt;'Grouped'[Resource Name],&lt;/P&gt;&lt;P class=""&gt;BLANK()&lt;/P&gt;&lt;P class=""&gt;),&lt;/P&gt;&lt;P class=""&gt;BLANK ()&lt;/P&gt;&lt;P class=""&gt;)&lt;/P&gt;&lt;P class=""&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 10:33:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hiding-visual-when-multiple-slicers/m-p/3350784#M125816</guid>
      <dc:creator>YellowSquirrel</dc:creator>
      <dc:date>2023-07-26T10:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Hiding visual when multiple slicers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hiding-visual-when-multiple-slicers/m-p/3412729#M129042</link>
      <description>&lt;P&gt;Firstly, your formula for hiding the table based on the T_Code slicer seems to be working just fine. That's a good start.&lt;/P&gt;
&lt;P&gt;Now, for the second tab where you have two slicers, you're trying to hide the table based on whether either of the slicers (MasterEmployeeName or Sub_Capability) is selected or not.&lt;/P&gt;
&lt;P&gt;Your individual tests for each slicer seem to indicate that the Sub_Capability slicer is working as expected, but the MasterEmployeeName slicer isn't.&lt;/P&gt;
&lt;P&gt;Considering that MasterEmployeeName is a calculated column, there's a possibility that the issue might be related to the way the column is calculated. However, before diving into that, let's first ensure that the logic for hiding/showing the table is correct.&lt;/P&gt;
&lt;P&gt;Your formula for VisualPeopleHideCol is:&lt;/P&gt;
&lt;P&gt;VisualPeopleHideCol = IF(OR(&lt;BR /&gt;ISFILTERED(Grouped[MasterEmployeeName]),ISFILTERED(tbl_Base_KeyDetails[Sub_Capability])),&lt;BR /&gt;1,&lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;This formula checks if either of the slicers is filtered. If either one is filtered, it returns 1, otherwise 0. This seems correct based on your requirement.&lt;/P&gt;
&lt;P&gt;Given that Test 2 doesn't work as expected, let's focus on the MasterEmployeeName slicer. The fact that it's a calculated column might be the root cause of the issue.&lt;/P&gt;
&lt;P&gt;The calculation for MasterEmployeeName is a bit complex. It checks if FullName is not blank, then it uses that. If FullName is blank, it checks other conditions and uses Resource Name if certain conditions are met.&lt;/P&gt;
&lt;P&gt;One thing to note is that slicers can sometimes behave unexpectedly with calculated columns, especially if the calculation involves other columns from the same table or other tables.&lt;/P&gt;
&lt;P&gt;Here's a suggestion: Instead of using the calculated column directly in the slicer, try creating a separate table that contains the unique values of MasterEmployeeName and use that table for the slicer. This way, you're not directly filtering on the calculated column, but on a static list of values derived from it.&lt;/P&gt;
&lt;P&gt;To create this table, you can use a DAX formula like:&lt;/P&gt;
&lt;P&gt;MasterEmployeeNames = VALUES(Grouped[MasterEmployeeName])&lt;BR /&gt;Then, use this new table for your slicer. Ensure that there's a relationship between this new table and your original Grouped table based on MasterEmployeeName.&lt;/P&gt;
&lt;P&gt;Once you've done this, test again with your VisualPeopleHideCol formula to see if the table hides/shows correctly based on the slicer selections.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2023 17:47:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hiding-visual-when-multiple-slicers/m-p/3412729#M129042</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2023-09-03T17:47:39Z</dc:date>
    </item>
  </channel>
</rss>

