<?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: Need help with DAX expression on RLS in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4639246#M177620</link>
    <description>&lt;P&gt;Hi JustinDoh1,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P class="" data-start="126" data-end="291"&gt;As mentioned earlier, please apply the DAX expression to the tblPBISecurity table for implementing Row-Level Security (RLS), and verify if it resolves the issue.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P class="" data-start="293" data-end="475"&gt;If you find our response helpful, kindly mark it as the accepted solution and consider giving kudos. This will be beneficial for other community members who may have similar queries.&lt;/P&gt;
&lt;P class="" data-start="477" data-end="487"&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Sat, 05 Apr 2025 08:38:29 GMT</pubDate>
    <dc:creator>v-pnaroju-msft</dc:creator>
    <dc:date>2025-04-05T08:38:29Z</dc:date>
    <item>
      <title>Need help with DAX expression on RLS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4637414#M177551</link>
      <description>&lt;P&gt;I have &lt;A href="https://drive.google.com/file/d/1c9FlrOowL9OmvJFmw8PxkGyvCAi4eis0/view?usp=sharing" target="_self"&gt;attached PBIX file here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to modify the bottom DAX so that it meets the condition of &lt;STRONG&gt;AccessToAllLocations = 'Yes' &lt;/STRONG&gt;as I intended.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bottom is current DAX that I have for RLS:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_Role&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MAXX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'tblPBIGroup'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'tblPBIGroup'&lt;/SPAN&gt;&lt;SPAN&gt;[User]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;USERPRINCIPALNAME&lt;/SPAN&gt;&lt;SPAN&gt;() ), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'tblPBIGroup'&lt;/SPAN&gt;&lt;SPAN&gt;[AccessToAllLocations]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;_Role&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Yes"&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;[User]&lt;/SPAN&gt;&lt;SPAN&gt; = &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;USERPRINCIPALNAME&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have two tables that are related to RLS:&lt;/DIV&gt;&lt;DIV&gt;1. '&lt;STRONG&gt;tblPBISecurity&lt;/STRONG&gt;' - this has all locations listed.&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;2. Second table is '&lt;STRONG&gt;tblPBIGroup&lt;/STRONG&gt;', which indicates that "AccessToAllLocations" is either 'Yes' or 'No'.&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The issue that I am having is when&amp;nbsp;"AccessToAllLocations" is 'Yes', it should allow access to both locations 'ART' and 'CAL', but it only allows access to the location that &lt;U&gt;&lt;STRONG&gt;is/are listed &lt;/STRONG&gt;&lt;/U&gt;on&amp;nbsp;tblPBIGroup (so in this case, it would only allow access to 'CAL' even though&amp;nbsp;"AccessToAllLocations" is 'Yes').&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bottom is expectation of results (indicated on inside screenshot):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;How can it be achievable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Apr 2025 21:46:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4637414#M177551</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-04-03T21:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX expression on RLS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4637594#M177563</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P class="" data-start="16" data-end="85"&gt;Thank you for reaching out to the Microsoft Fabric Community Forum.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P class="" data-start="87" data-end="242"&gt;Please find the revised DAX expression to be applied to the tblPBISecurity table for Row-Level Security (RLS). Kindly check if it resolves the issue:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P data-pm-slice="0 0 []"&gt;VAR _User = USERPRINCIPALNAME()&lt;/P&gt;
&lt;P&gt;VAR _AccessToAll = MAXX(&lt;/P&gt;
&lt;P&gt;FILTER( 'tblPBIGroup', 'tblPBIGroup'[User] = _User ),&lt;/P&gt;
&lt;P&gt;'tblPBIGroup'[AccessToAllLocations]&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;VAR _UserLocation = MAXX(&lt;/P&gt;
&lt;P&gt;FILTER( 'tblPBIGroup', 'tblPBIGroup'[User] = _User ),&lt;/P&gt;
&lt;P&gt;'tblPBIGroup'[Location]&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;RETURN&lt;/P&gt;
&lt;P&gt;IF(&lt;/P&gt;
&lt;P&gt;_AccessToAll = "Yes",&lt;/P&gt;
&lt;P&gt;TRUE(),&lt;/P&gt;
&lt;P&gt;'tblPBISecurity'[Group] = _UserLocation&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P class="" data-start="87" data-end="242"&gt;&lt;BR /&gt;If you find our response helpful, we kindly request you to mark it as the accepted solution and provide kudos. This will assist other community members who may have similar queries.&lt;/P&gt;
&lt;P class="" data-start="809" data-end="821"&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 05:28:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4637594#M177563</guid>
      <dc:creator>v-pnaroju-msft</dc:creator>
      <dc:date>2025-04-04T05:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX expression on RLS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4638659#M177605</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="814008" data-lia-user-login="v-pnaroju-msft" class="lia-mention lia-mention-user"&gt;v-pnaroju-msft&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having an error recognizing a table value ('tblPBISecurity'[Group]) because, I think, the DAX is currently pointing to tblPBIGroup on the expression Window on the right side.&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;How do we fix this issue?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 17:20:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4638659#M177605</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-04-04T17:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX expression on RLS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4639246#M177620</link>
      <description>&lt;P&gt;Hi JustinDoh1,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P class="" data-start="126" data-end="291"&gt;As mentioned earlier, please apply the DAX expression to the tblPBISecurity table for implementing Row-Level Security (RLS), and verify if it resolves the issue.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P class="" data-start="293" data-end="475"&gt;If you find our response helpful, kindly mark it as the accepted solution and consider giving kudos. This will be beneficial for other community members who may have similar queries.&lt;/P&gt;
&lt;P class="" data-start="477" data-end="487"&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Apr 2025 08:38:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4639246#M177620</guid>
      <dc:creator>v-pnaroju-msft</dc:creator>
      <dc:date>2025-04-05T08:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX expression on RLS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4640103#M177653</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="814008" data-lia-user-login="v-pnaroju-msft" class="lia-mention lia-mention-user"&gt;v-pnaroju-msft&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting this error:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to unclick this (Apply security filter in both directions), then?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry.&lt;/P&gt;&lt;P&gt;I also have two more questions:&lt;/P&gt;&lt;P&gt;1. If I want multiple locations to be in the condition for _UserLocation, how do I modify the MAXX with?&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. On bottom DAX. What does '&lt;STRONG&gt;TRUE()&lt;/STRONG&gt;' mean?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_Acces&lt;/SPAN&gt;&lt;SPAN&gt;sToA&lt;/SPAN&gt;&lt;SPAN&gt;ll&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Yes"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;TRUE&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;()&lt;/STRONG&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'tblP&lt;/SPAN&gt;&lt;SPAN&gt;BIS&lt;/SPAN&gt;&lt;SPAN&gt;ecur&lt;/SPAN&gt;&lt;SPAN&gt;ity'[&lt;/SPAN&gt;&lt;SPAN&gt;Group] = _UserLo&lt;/SPAN&gt;&lt;SPAN&gt;cation&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 22:45:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4640103#M177653</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-04-07T22:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX expression on RLS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4642988#M177777</link>
      <description>&lt;P&gt;Hi JustinDoh1,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P class="" data-start="124" data-end="522"&gt;Based on my understanding, the Security Cross Filtering error arises due to the Apply security filter in both directions setting. Kindly uncheck this option in the relationship between tblPBIGroup and tblPBISecurity, and set the direction to Single from tblPBIGroup to tblPBISecurity. Then, reapply the DAX expression to tblPBISecurity. This should help resolve the issue.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;OL data-start="524" data-end="604"&gt;
&lt;LI class="" data-start="524" data-end="604"&gt;
&lt;P class="" data-start="527" data-end="604"&gt;For handling multiple locations, please use the updated DAX expression below:&lt;BR /&gt;VAR _User = USERPRINCIPALNAME()&lt;/P&gt;
&lt;P&gt;VAR _AccessToAll = MAXX(FILTER('tblPBIGroup', 'tblPBIGroup'[User] = _User), 'tblPBIGroup'[AccessToAllLocations])&lt;/P&gt;
&lt;P&gt;VAR _UserLocations = FILTER('tblPBIGroup', 'tblPBIGroup'[User] = _User)&lt;/P&gt;
&lt;P&gt;RETURN&lt;/P&gt;
&lt;P&gt;IF(&lt;/P&gt;
&lt;P&gt;_AccessToAll = "Yes",&lt;/P&gt;
&lt;P&gt;TRUE(),&lt;/P&gt;
&lt;P&gt;'tblPBISecurity'[Group] IN SELECTCOLUMNS(_UserLocations, "Location", 'tblPBIGroup'[Location])&lt;/P&gt;
&lt;P&gt;)&lt;BR /&gt;&lt;BR /&gt;This logic allows users to access multiple locations as listed in the tblPBIGroup table.&lt;BR /&gt;&lt;BR /&gt;2.The TRUE() function grants unrestricted access to all rows in tblPBISecurity when AccessToAllLocations is set to Yes. Otherwise, it restricts access based on the specific locations.&lt;/P&gt;
&lt;P class="" data-start="984" data-end="1076"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="" data-start="1332" data-end="1509"&gt;If you find this response helpful, kindly mark it as the accepted solution and consider giving kudos. This will be beneficial for other community members facing similar queries.&lt;/P&gt;
&lt;P class="" data-start="1511" data-end="1521"&gt;Thank you.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 08 Apr 2025 11:42:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4642988#M177777</guid>
      <dc:creator>v-pnaroju-msft</dc:creator>
      <dc:date>2025-04-08T11:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX expression on RLS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4643617#M177796</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="814008" data-lia-user-login="v-pnaroju-msft" class="lia-mention lia-mention-user"&gt;v-pnaroju-msft&lt;/a&gt;&amp;nbsp;Thank you so much for all your help.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 17:19:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-expression-on-RLS/m-p/4643617#M177796</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-04-08T17:19:21Z</dc:date>
    </item>
  </channel>
</rss>

