<?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: Dynamic RLS with User in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-RLS-with-User/m-p/4593203#M175899</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="702353" data-lia-user-login="ashmitp869" class="lia-mention lia-mention-user"&gt;ashmitp869&lt;/a&gt;&amp;nbsp;So, normally you would create a user's table that would have the User_id and Email and you would relate that to your Core_UserProject table. Your Core_UserProject table would be related to your Projects table. So you would configure your RLS rule against your Users table using USERPRINCIPALNAME.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Mar 2025 15:40:12 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2025-03-03T15:40:12Z</dc:date>
    <item>
      <title>Dynamic RLS with User</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-RLS-with-User/m-p/4592040#M175859</link>
      <description>&lt;P&gt;Hi All&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I tried to make a dynamic RLS per user, but I was unable to make it access according to requirement.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The requriement would be that users 9 or User 1 can access the for respective Project_id - which is table &lt;STRONG&gt;Core_UserProject&lt;BR /&gt;&lt;/STRONG&gt;User_id 9 should only view the project_id 1 and 5&lt;/P&gt;&lt;P&gt;User_id 7 should only view the project_id&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the dax code I made against the &lt;STRONG&gt;Projects&lt;/STRONG&gt; Table :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _Restriction = 
CALCULATETABLE(
    VALUES( Core_UserProject[Project_id]),
    Core_UserProject[Email] = USERPRINCIPALNAME()
)
VAR RLS_Restriction =
SWITCH(
    TRUE(),
    _Restriction = "None", TRUE(),
    Projects[Project_id]=_Restriction,TRUE(),
    FALSE()
)
RETURN
RLS_Restriction&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the bases and their respective relationship:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Projects&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Core_UserProject&lt;/STRONG&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sample file link&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/suvechha/samplepbi/blob/main/sample_info%20-%20security.pbix" target="_blank"&gt;https://github.com/suvechha/samplepbi/blob/main/sample_info%20-%20security.pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 02 Mar 2025 23:53:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-RLS-with-User/m-p/4592040#M175859</guid>
      <dc:creator>ashmitp869</dc:creator>
      <dc:date>2025-03-02T23:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic RLS with User</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-RLS-with-User/m-p/4592071#M175860</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="252271" data-lia-user-login="v-xul" class="lia-mention lia-mention-user"&gt;v-xul&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="558101" data-lia-user-login="v-xiaoql" class="lia-mention lia-mention-user"&gt;v-xiaoql&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="116833" data-lia-user-login="v-xicai" class="lia-mention lia-mention-user"&gt;v-xicai&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;Any assistance.&lt;BR /&gt;Thanks&lt;/P&gt;&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;</description>
      <pubDate>Mon, 03 Mar 2025 00:50:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-RLS-with-User/m-p/4592071#M175860</guid>
      <dc:creator>ashmitp869</dc:creator>
      <dc:date>2025-03-03T00:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic RLS with User</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-RLS-with-User/m-p/4593203#M175899</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="702353" data-lia-user-login="ashmitp869" class="lia-mention lia-mention-user"&gt;ashmitp869&lt;/a&gt;&amp;nbsp;So, normally you would create a user's table that would have the User_id and Email and you would relate that to your Core_UserProject table. Your Core_UserProject table would be related to your Projects table. So you would configure your RLS rule against your Users table using USERPRINCIPALNAME.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 15:40:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-RLS-with-User/m-p/4593203#M175899</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2025-03-03T15:40:12Z</dc:date>
    </item>
  </channel>
</rss>

