<?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: Default Filter Based on Logged-in User Fails to Work Without Manual Interaction in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4664696#M178652</link>
    <description>&lt;P&gt;You can use the technique described in&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/customizing-default-values-for-each-user-in-power-bi-reports/" target="_self"&gt;https://www.sqlbi.com/articles/customizing-default-values-for-each-user-in-power-bi-reports/&lt;/A&gt;&amp;nbsp;to set default values per user while still allowing them to override the defaults if they so choose.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Apr 2025 10:23:57 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2025-04-23T10:23:57Z</dc:date>
    <item>
      <title>Default Filter Based on Logged-in User Fails to Work Without Manual Interaction</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4664297#M178632</link>
      <description>&lt;P class=""&gt;Hi everyone,&lt;/P&gt;&lt;P class=""&gt;I'm trying to implement user-specific default filtering in my Power BI report based on the logged-in user's email address.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;What I want to achieve:&lt;/H3&gt;&lt;P class=""&gt;I want each user to see a specific default view (filtered dataset) &lt;STRONG&gt;based on a value from a user table&lt;/STRONG&gt; (DIM_USERNAME_SF). This is not related to row-level security – it's simply to show a filtered page relevant to the user &lt;STRONG&gt;by default&lt;/STRONG&gt;, without needing any manual filtering.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;My setup:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;I have a table DIM_USERNAME_SF that contains user emails and a column called ALLOWED, which stores a value (e.g., unit number) specific to each user.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;The main data table (v_SLA_SF) includes a column called MOKED, which should match the ALLOWED value from the user table.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;I created a measure to check if the current row matches the logged-in user's allowed value. Here's the DAX:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;userUnitFlag :=&lt;BR /&gt;VAR UserEmail = USERPRINCIPALNAME()&lt;BR /&gt;VAR UserAllowedUnit =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX(DIM_USERNAME_SF[ALLOWED]),&lt;BR /&gt;FILTER(DIM_USERNAME_SF, DIM_USERNAME_SF[EMAIL] = UserEmail)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF (UserAllowedUnit = MAX(v_SLA_SF[MOKED]), 1, 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;This measure works &lt;EM&gt;only&lt;/EM&gt; if I manually apply a visual filter using userUnitFlag = 1.&lt;/P&gt;&lt;P class=""&gt;However, if I try to use this logic to filter visuals dynamically (i.e., without user interaction), &lt;STRONG&gt;the visual displays blank&lt;/STRONG&gt;. It seems the DAX is not triggering correctly unless the filter is explicitly set by the user via the slicer or visual-level filter panel.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;About the relationship:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;There is no active relationship between DIM_USERNAME_SF and v_SLA_SF, as I'm using a calculated measure instead of a column.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;I prefer not to use row-level security or dynamic parameters – I simply want the report to behave as if the filter was already applied when the user opens it.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;My question:&lt;/H3&gt;&lt;P class=""&gt;Is there a way to apply this kind of user-based filtering &lt;STRONG&gt;automatically&lt;/STRONG&gt;, using just DAX and a user table (without RLS), so that the visuals display the right data &lt;EM&gt;by default&lt;/EM&gt;?&lt;/P&gt;&lt;P class=""&gt;Any ideas on how to make this logic apply without needing manual interaction?&lt;/P&gt;&lt;P class=""&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 06:19:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4664297#M178632</guid>
      <dc:creator>dorku</dc:creator>
      <dc:date>2025-04-23T06:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Default Filter Based on Logged-in User Fails to Work Without Manual Interaction</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4664314#M178635</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="906988" data-lia-user-login="dorku" class="lia-mention lia-mention-user"&gt;dorku&lt;/a&gt;&amp;nbsp;You already have a measure userUnitFlag that checks if the current row matches the logged-in user's allowed value. Ensure this measure is correctly defined as follows:&lt;/P&gt;
&lt;P&gt;dax&lt;BR /&gt;userUnitFlag :=&lt;BR /&gt;VAR UserEmail = USERPRINCIPALNAME()&lt;BR /&gt;VAR UserAllowedUnit =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX(DIM_USERNAME_SF[ALLOWED]),&lt;BR /&gt;FILTER(DIM_USERNAME_SF, DIM_USERNAME_SF[EMAIL] = UserEmail)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF (UserAllowedUnit = MAX(v_SLA_SF[MOKED]), 1, 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you want the filter to be applied automatically, you need to set this measure as a filter on all relevant visuals. Here’s how you can do it:&lt;/P&gt;
&lt;P&gt;Go to each visual where you want the filter to be applied.&lt;BR /&gt;In the Visualizations pane, drag the userUnitFlag measure to the Filters on this visual section.&lt;BR /&gt;Set the filter condition to userUnitFlag is equal to 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 06:30:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4664314#M178635</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-04-23T06:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Default Filter Based on Logged-in User Fails to Work Without Manual Interaction</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4664344#M178636</link>
      <description>&lt;P class=""&gt;Hi, thank you for your help!&lt;/P&gt;&lt;P class=""&gt;As I mentioned earlier, the issue is that when I apply the userUnitFlag = 1 filter directly to the visual, the entire chart becomes blank — completely white, with no data at all.&lt;/P&gt;&lt;P class=""&gt;The strange part is that this doesn’t happen when I apply the same filter manually through a slicer or interactively from outside the visual. In that case, it works just fine.&lt;/P&gt;&lt;P class=""&gt;I’m wondering if this might be related to the fact that I’m using a &lt;STRONG&gt;live connection to a Tabular model&lt;/STRONG&gt;, but I’m not entirely sure. Any ideas?&lt;/P&gt;&lt;P class=""&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 06:51:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4664344#M178636</guid>
      <dc:creator>dorku</dc:creator>
      <dc:date>2025-04-23T06:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Default Filter Based on Logged-in User Fails to Work Without Manual Interaction</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4664696#M178652</link>
      <description>&lt;P&gt;You can use the technique described in&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/customizing-default-values-for-each-user-in-power-bi-reports/" target="_self"&gt;https://www.sqlbi.com/articles/customizing-default-values-for-each-user-in-power-bi-reports/&lt;/A&gt;&amp;nbsp;to set default values per user while still allowing them to override the defaults if they so choose.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 10:23:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4664696#M178652</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-04-23T10:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Default Filter Based on Logged-in User Fails to Work Without Manual Interaction</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4672912#M178960</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="906988" data-lia-user-login="dorku" class="lia-mention lia-mention-user"&gt;dorku&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for being part of the Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;As highlighted by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp;, the proposed approach appears to effectively address your requirements. Could you please confirm if your issue has been resolved?&lt;BR /&gt;If you are still facing any challenges, kindly provide further details, and we will be happy to assist you.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Best Regards,&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Community Support Team _ C Srikanth.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 12:11:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4672912#M178960</guid>
      <dc:creator>v-csrikanth</dc:creator>
      <dc:date>2025-04-29T12:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Default Filter Based on Logged-in User Fails to Work Without Manual Interaction</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4673084#M178965</link>
      <description>&lt;P&gt;i did, thank you very much for your help&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 13:44:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-Filter-Based-on-Logged-in-User-Fails-to-Work-Without/m-p/4673084#M178965</guid>
      <dc:creator>dorku</dc:creator>
      <dc:date>2025-04-29T13:44:52Z</dc:date>
    </item>
  </channel>
</rss>

