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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Paulyeo11
Impactful Individual
Impactful Individual

Manage roles using ISMANAGER =1 and USERPRINCIPAL

Hi All

 

I Refer to Below link is the instruction 

https://community.powerbi.com/t5/MBAS-Gallery/Microsoft-Power-BI-Unleash-row-level-security-patterns...

I follow the above link at  10 min 11 sec , it mentioned create a section access table.

I create a new Table at PBI , and enter the below info :-

Paulyeo11_0-1607781994334.png

I also create another section access table and enter below info :-

Paulyeo11_2-1607782214279.png

I insert the below code at manage role , at Section access Table :-

=if ( LOOKUPVALUE( 'SOURCE'[ISMANAGER], 'SOURCE'[EMAIL], USERPRINCIPALNAME()) = 0,
[USER] = USERPRINCIPALNAME(),
TRUE()
)

I am getting error.

 
 
 
 
 

Can some one share with me where go wrong ?

 
 

https://www.dropbox.com/preview/25%20Temp%20PBI%20file%20to%20Forum%20need%20delete/Section%20Access...

 

Above My PBI file :-

Paul

1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

Remember, what you see in the desktop when you view the roles is what you gat to see in the service.

so you either go back to your desktop and try again or in the service you didn't affect the right email to the right role. as simple as that.

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

17 REPLIES 17
aj1973
Community Champion
Community Champion

Your PBIX file dosen't exist in the Dropbox!!

Your code is not quit correct.

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Paulyeo11
Impactful Individual
Impactful Individual

Hi aj

 

Thank you for sharing. Hope you can help to let me know where go wrong ?

 

Below is my PBI file :-

https://www.dropbox.com/s/0jcn5qp0m3co37m/Section%20Access%20V001.pbix?dl=0

 

Paul

 

aj1973
Community Champion
Community Champion

2 Mistakes : "=" before the if and the table "SOURCE" !!!

aj1973_0-1607898215900.png

 

Where is the Table "SOURCE"?

aj1973_1-1607898329428.png

 

And, what is that you really want to do? Why using LOOKUPVALUE?

 

it is just not clear what you want to achieve.

 

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Paulyeo11
Impactful Individual
Impactful Individual

Hi aj

Thank you very much for sharig , my data model does have the SOURCE filed.

 

i also try to rename Table name to SOURCE , it still unable to work.

Paulyeo11_1-1607899348119.png

My objective is to create section access , so that , ISMANAGER email address can access all SOURCE value label.  with out ISMANAGER =1 email address can only access their respective SOUCE VALUE LABEL = TS

Paulyeo11_2-1607899430128.png

 

Paul Yeo

aj1973
Community Champion
Community Champion

Well, let Power BI do the work for you and don't use unapropriate DAX formulas.

Use filters on your tables as like as you want by just adding the email of the manger who will access to what through these filters

aj1973_0-1607899923986.pngaj1973_1-1607900070933.png

 

this is the most i can help you with in my understanding.

 

Good Luck Paul

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Paulyeo11
Impactful Individual
Impactful Individual

Hi aj

I try to apply your code , i get error , hope you can advise me.

Paulyeo11_0-1607901048574.png

My PBI file

https://www.dropbox.com/s/wiaikmqkoxka9cy/Section%20Access%20V002.pbix?dl=0

 

Paul 

aj1973
Community Champion
Community Champion

It's working fine for me

aj1973_0-1607902352736.png

here is the formula

[SOURCE]="ADMIN@TDSTECH.COM"


&& [ISMANAGER] = 0
&& [SOURCE] = "paulyeo@tdstech.com"

 

Copy paste it and name your role, it's very important

 

The view of your role displays blank values

aj1973_1-1607902545102.png

 

just to let you know

 

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Paulyeo11
Impactful Individual
Impactful Individual

Hi aj

I have follow your instruction , but when view as paulyeo@tdstech.com i can view both SOURCE.

When i view as admin@tdstech.com  i also can view both SOURCE.

 

https://www.dropbox.com/s/12mtknlr1dfo6si/Section%20Access%20V005.pbix?dl=0

Paulyeo11_0-1607903542560.png

Paulyeo11_1-1607903663595.png

mAY i know where go wrong ?

Paul

aj1973
Community Champion
Community Champion

That's what I was trying to tell you...

Your code is not clear what is that you want to see! you are using many filters for one specific job! what is it?

 

If you tell me what is the picture you want to see, I might be able to help you.

 

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Paulyeo11
Impactful Individual
Impactful Individual

Hi aj

 

I was watching below video , at 10 min 11 sec , the objective for me is create section access , so that manager email can access all SOURCE field. and other email who are not manager , can only view SOURCE=TS

https://community.powerbi.com/t5/MBAS-Gallery/Microsoft-Power-BI-Unleash-row-level-security-patterns...

.

aj1973
Community Champion
Community Champion

Well, create a Role for the Boss with no filters applied

aj1973_0-1607905415808.png

 

then a role for each user

aj1973_1-1607905472300.png

 

no need to use table SOURCE.

aj1973_2-1607905552361.png

 

 

it's all about how to use your filters for the specific role

 

 

 

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Paulyeo11
Impactful Individual
Impactful Individual

Hi aj

I have follow your instruction , it work fine , next is i upload the PBI to web service

Paulyeo11_0-1607906895059.png

Then i create , member for the role :-

Paulyeo11_1-1607906996070.png

When i try to log in using both email , i am able to view SOURCE = TS & PM

Where i go wrong ?

Paul

 

aj1973
Community Champion
Community Champion

Did you add

aj1973_0-1607909574968.png

 

and

aj1973_1-1607909596267.png

 

 

If so then Great you did it.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

aj1973
Community Champion
Community Champion

Remember, what you see in the desktop when you view the roles is what you gat to see in the service.

so you either go back to your desktop and try again or in the service you didn't affect the right email to the right role. as simple as that.

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Paulyeo11
Impactful Individual
Impactful Individual

Hi aj

I have try to send the report to admin@tdstech.com , and i set the security , and i share the report with paulyeo@tdstech.com

yes it work fine now. Thank you very much for your help . Now i try to implement on my acrual doc.

Paul Yeo

littlemojopuppy
Community Champion
Community Champion

Your approach isn't quite right.  Here's a link to DAX Reference Guide for using Parent - Child Relationships.  Here's a link to Dax Patterns on how to implement Parent Child Hierarchies.

Hi Little

Thank you for the link :-

https://community.powerbi.com/t5/Desktop/Manage-roles-using-ISMANAGER-1-and-USERPRINCIPAL/m-p/154743...

I notice that the link is very helpful for create P&L in PBI

Paul

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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