The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi BI Community Team,
Currently I have an issue of report display and show when user login and check it. We have 04 levels as the screenshot below, as per expectation want to see report when login like:
> SalesRep --> able to see their own performance
> Supervisor --> able to see their team (salesrep) only (unable to see another team)
> Manager --> able to see their supervisor only (Not required to see salesrep)
> National Manager --> able to see their manager (Not required to see sales rep)
Sample link - https://drive.google.com/drive/folders/1RP_5o9U4FEi325aM2_jncFUEsn07Zw6D?usp=sharing
Any suggestion/advise?
Thanks and Regards,
Hi @ADSL
Try the following code in RLS
var a=LOOKUPVALUE ( 'SalesRep'[Employee_ID], 'SalesRep'[Email], USERPRINCIPALNAME () )
return CONTAINSSTRING( 'SalesRep'[Path],a)
2.Then create a new table and hide it.
Table = SUMMARIZE(SalesRep,[Employee_ID])
3.Then create a measure and put it to the visual filter.
MEASURE =
VAR a =
LOOKUPVALUE ( SalesRep[Pathlength], SalesRep[Email], USERPRINCIPALNAME () )
RETURN
IF (
a <> 1
&& COUNTROWS ( ALL ( 'Table' ) ) = COUNTROWS ( ALL ( SalesRep ) ),
1,
IF (
( a = 3 )
|| ( a = 4 )
|| (
a = 1
&& MAX ( SalesRep[Level 3] ) = BLANK ()
)
|| (
a = 2
&& MAX ( SalesRep[Level 4] ) = BLANK ()
),
1
)
)
Test it .
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous,
Thank you for helpful feedback.
But it doesn't show any result of these user account sm@demo.com or nsm@demo.com when login as your output screenshot.
Actually it should show the result of Supervisor01, Supervisor02,...etc.
Any suggestion/advise of this case?
Thanks and Regards,
Hi @ADSL
Actually, when there is no rls applied in the matrix, the value is also blank, you need to check your measure.
Best Regards!
Yolo Zhu
Hi @Anonymous,
I'm also a bit challenge of this case.
May I need your support of this measure to apply?
Thanks and Regards,
Hi @ADSL
I mean that when there is not rls, the [Plan] and [Actural] measures are also blank, you need to check your Plan and actual measures.
Best Regards!
Yolo Zhu
Hi @Anonymous ,
Sorry to bother you again. Could you please assist to show me more detail about it? because I am just learning and not understand so much.
Thanks and Regards,
Hi @ADSL
I don't know the logic of your two measures, I provide a solution to help you implement the user information you need to display, but the displayed values are empty because the measures you wrote yourself cause blanks, you need to check the measures you created yourself, such as your [Actual] and [Plan] measures, these two measures are null in the matrix for some users before I provide the solution.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello :
Try to think of a hierarechy and set a role for each one , then in the service just assign the role for each person .