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.
Hello Everyone,
I have 2 data sets, User and dealers under them & another one is Opportunities data where I have leads data from buyers from different countries. Both the tables are modeled based on dealer id.
The user in above data have different roles, my requirement now is for just role 3 user id's, they should see only Opportunities of their respective coutry and for rest of the role they can see all countries data. But with my current modeling they are able to see all data based on dealer id modeling.
Example: user id 3 has access to OpportunityId 4 & 5 but he should see only OpportunityId 5 since his country is US.
Similary User id 5 should see only OpportunityId 6 & not 8.
But for a super user like say User id 1 he should see both OpportunityId 1 & 2 which is of CA and US.
Could any one help me with how to acheive this based on current modeling and role based user's country as well.
@v-kkf-msft , In my case RLS is based on User id, each user has set of dealers under them and also each user has a role defined to them. Above case will not fit perfectly to my scenario and also you have used static role number, what if user other than role 3 will login? It has to be completely dynamic based on avaiable role and user id.
Hi @Senthil_Kumar ,
First create a relationship between [Dealer id].
Then create the following filters for role 3.
[User role] = 3
CALCULATE (
COUNTROWS ( Opportunities ),
INTERSECT (
SUMMARIZE (
Opportunities,
Opportunities[Dealer id],
Opportunities[Opportunity_Country]
),
SUMMARIZE (
FILTER ( User_Dealer, User_Dealer[User role] = 3 ),
User_Dealer[Dealer id],
User_Dealer[User Country]
)
)
) > 0
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sounds like you need a composite key "Dealer-Country" in both tables.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |