Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
abhiram342
Microsoft Employee
Microsoft Employee

Table level Security not working as expected

Hi Team,

 

I want to hide fact table , if user is not present in User Table. Please find example below

User

Alias
user1@xyz.com
user2@xyz.com

Fact Sales

DateIdSalesAmount
20220101100

Implementation:

I have used tabular Editor and selected Fact Sales and Updated Object level Security to None

Roles:

I went to manage roles and created role with below dax code

RoleName: HideFactSales

IF(NOT ISEMPTY(FILTER(VALUES(User),User[User Alias] = USERPRINCIPALNAME())),FALSE(),TRUE())

Testing in local:

Consider my alias as user1@xyz.com

I have selected role as HideFactSales but table is hidden for me. I expect the FactSales to show because I'm valid user

Please let me if I'm missing anything.

 

I have published report to PowerBI Service and added my alias to Security section but it shows same behaviour. Please assist

 

Note: I  have been assigned as contributor role to workspace.

 

Thanks,

Abhiram

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @abhiram342 ,

According to your description, I create a sample, and apply your code, got the opposite result you expected.

vkalyjmsft_0-1653877097207.png

vkalyjmsft_1-1653877130795.png

The meaning of "NOT ISEMPTY(FILTER(VALUES(User),User[User Alias] = USERPRINCIPALNAME()))" is that user is in User Table, so you should remove NOT here, modify to:

IF (
    ISEMPTY ( FILTER ( VALUES ( User ), User[Alias] = USERPRINCIPALNAME () ) ),
    FALSE (),
    TRUE ()
)

Get the correct result.

vkalyjmsft_2-1653877699133.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @abhiram342 ,

According to your description, I create a sample, and apply your code, got the opposite result you expected.

vkalyjmsft_0-1653877097207.png

vkalyjmsft_1-1653877130795.png

The meaning of "NOT ISEMPTY(FILTER(VALUES(User),User[User Alias] = USERPRINCIPALNAME()))" is that user is in User Table, so you should remove NOT here, modify to:

IF (
    ISEMPTY ( FILTER ( VALUES ( User ), User[Alias] = USERPRINCIPALNAME () ) ),
    FALSE (),
    TRUE ()
)

Get the correct result.

vkalyjmsft_2-1653877699133.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.