Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Requirement - Apply RLS
What DAX i will write to filter data
NOTE- IF user have an access of two state like MH and MP , but its having an only one company access "google" then he can be only show data of google company not for other company from another state
@amitchandak @Greg_Deckler
Solved! Go to Solution.
HI @ashishg,
Did you mean the company RLS table is the role settings you want to filter on these tables? Is there any index fields include in your ‘State RLS’ table?
I'd like to suggest you can use the current username and index field to find out the first ‘State’. Then you can use the ‘State’ as condition to lookup the ‘report fact’ table by ‘State’ and ‘product ID’ to find out first company.
After these steps, you can extract the result 'company' and current 'username' to apply RLS filter on table feilds.
Regards,
Xiaoxin Sheng
here is the tables , I'm not able to attached pbix file, Relationship as shown in above image
ReportFact
ProductID | State | Price | Company |
1 | MH | 20 | |
2 | MH | 20 | |
3 | MH | 10 | |
4 | MH | 30 |
|
2. CompanyRLS
Company | |
abc@gmail.com | |
pqr@gmail.com | amazon |
3. StateRLS
State | |
abc@gmail.com | MH |
pqr@gmail.com | KL |
abc@gmail.com | MP |
HI @ashishg,
Did you mean the company RLS table is the role settings you want to filter on these tables? Is there any index fields include in your ‘State RLS’ table?
I'd like to suggest you can use the current username and index field to find out the first ‘State’. Then you can use the ‘State’ as condition to lookup the ‘report fact’ table by ‘State’ and ‘product ID’ to find out first company.
After these steps, you can extract the result 'company' and current 'username' to apply RLS filter on table feilds.
Regards,
Xiaoxin Sheng
Hi @ashishg ,
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
User | Count |
---|---|
93 | |
83 | |
77 | |
73 | |
66 |
User | Count |
---|---|
115 | |
104 | |
93 | |
64 | |
61 |