<?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 Table level Security not working as expected in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-level-Security-not-working-as-expected/m-p/2540511#M71543</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to hide fact table , if user is not present in User Table. Please find example below&lt;/P&gt;&lt;P&gt;User&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Alias&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;user1@xyz.com&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;user2@xyz.com&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Fact Sales&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DateId&lt;/TD&gt;&lt;TD&gt;SalesAmount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20220101&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Implementation:&lt;/P&gt;&lt;P&gt;I have used tabular Editor and selected Fact Sales and Updated Object level Security to None&lt;/P&gt;&lt;P&gt;Roles:&lt;/P&gt;&lt;P&gt;I went to manage roles and created role with below dax code&lt;/P&gt;&lt;P&gt;RoleName: HideFactSales&lt;/P&gt;&lt;P&gt;IF(NOT ISEMPTY(FILTER(VALUES(User),User[User Alias] = USERPRINCIPALNAME())),FALSE(),TRUE())&lt;/P&gt;&lt;P&gt;Testing in local:&lt;/P&gt;&lt;P&gt;Consider my alias as&amp;nbsp;user1@xyz.com&lt;/P&gt;&lt;P&gt;I have selected role as HideFactSales but table is hidden for me. I expect the FactSales to show because I'm valid user&lt;/P&gt;&lt;P&gt;Please let me if I'm missing anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have published report to PowerBI Service and added my alias to Security section but it shows same behaviour. Please assist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I&amp;nbsp; have been assigned as contributor role to workspace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiram&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2022 05:27:36 GMT</pubDate>
    <dc:creator>abhiram342</dc:creator>
    <dc:date>2022-05-26T05:27:36Z</dc:date>
    <item>
      <title>Table level Security not working as expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-level-Security-not-working-as-expected/m-p/2540511#M71543</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to hide fact table , if user is not present in User Table. Please find example below&lt;/P&gt;&lt;P&gt;User&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Alias&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;user1@xyz.com&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;user2@xyz.com&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Fact Sales&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DateId&lt;/TD&gt;&lt;TD&gt;SalesAmount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20220101&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Implementation:&lt;/P&gt;&lt;P&gt;I have used tabular Editor and selected Fact Sales and Updated Object level Security to None&lt;/P&gt;&lt;P&gt;Roles:&lt;/P&gt;&lt;P&gt;I went to manage roles and created role with below dax code&lt;/P&gt;&lt;P&gt;RoleName: HideFactSales&lt;/P&gt;&lt;P&gt;IF(NOT ISEMPTY(FILTER(VALUES(User),User[User Alias] = USERPRINCIPALNAME())),FALSE(),TRUE())&lt;/P&gt;&lt;P&gt;Testing in local:&lt;/P&gt;&lt;P&gt;Consider my alias as&amp;nbsp;user1@xyz.com&lt;/P&gt;&lt;P&gt;I have selected role as HideFactSales but table is hidden for me. I expect the FactSales to show because I'm valid user&lt;/P&gt;&lt;P&gt;Please let me if I'm missing anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have published report to PowerBI Service and added my alias to Security section but it shows same behaviour. Please assist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I&amp;nbsp; have been assigned as contributor role to workspace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiram&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 05:27:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-level-Security-not-working-as-expected/m-p/2540511#M71543</guid>
      <dc:creator>abhiram342</dc:creator>
      <dc:date>2022-05-26T05:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Table level Security not working as expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-level-Security-not-working-as-expected/m-p/2546404#M71938</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="135733" data-lia-user-login="abhiram342" class="lia-mention lia-mention-user"&gt;abhiram342&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;P&gt;According to your description, I create a sample, and apply your code, got the opposite result you expected.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The meaning of "&lt;SPAN&gt;NOT ISEMPTY(FILTER(VALUES(User),User[User Alias] = USERPRINCIPALNAME()))" is that user is in User Table, so you should remove NOT here, modify to:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF (
    ISEMPTY ( FILTER ( VALUES ( User ), User[Alias] = USERPRINCIPALNAME () ) ),
    FALSE (),
    TRUE ()
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;Get the correct result.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 02:29:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-level-Security-not-working-as-expected/m-p/2546404#M71938</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-05-30T02:29:24Z</dc:date>
    </item>
  </channel>
</rss>

