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.
after smashing my face against the proverbial brick wall and finding only basic instructions on RLS - thought I'd try to get some real help. I'm hoping you guys might save me!
I have a fairly simple RLS Model, but as part of that, people are tagged as either controllers or not. The controllers will be able to see my 'draft' period whilst others accessing the same report would only see the latest published figure. I'm trying to do this via field parameter to get a 'rolling' date based on the above rule - but I can't get a switch to apply.
Essentially, All I want to do is RETURN a value of Y or N based on the RLS result. Obviously - applying that gives me a single row of data. all good. but whatever I try to pull the result of the Y/N field - it always brings back the max value. I've tried SELECTEDVALUE, MAX, MAXX, FIRSTNONBLANK.
uam_persona
controller | |
thisisme.com | Y |
someoneelse.com | N |
Ctrl_Period (these have been placed into measures)
ReportDraft | ReportLive |
202405 | 202404 |
RLS Model (against uam_persona)
email=USERPRINCIPALNAME()
logic that I essentially need to apply is:-
VAR _Controller = uam_persona[Controller]
VAR _RptPeriod = IF(_Controller="Y",ReportDraft,ReportLive)
I'd really like to simply bring back the UPN as a string so that I can do all the subsequent controls. There are a lot of further dynamics in the report all hinged on whether a user is a controller or not. so a simple 'marker' in a control table somewhere is what I want. I've tried using date tables but returning the value always evaluates the whole table, not just the tabled filtered by RLS.
Apologies for the rambling post ... my head hurts from all the smashing .. so ANY help would be hugely appreciated!
Solved! Go to Solution.
Hi @David_Ramos ,
I did not reproduce your problem in my testing.
Below is my testing process.
The data table is shown below. Contains the UPN of two real users.
Set up the RLS model.
Create a measure to dynamically display the report period.
Ctrl_Period = IF(SELECTEDVALUE(uam_persona[controller])="Y",[ReportDraft],[ReportLive])
The designed local report is below.
Then publish to Power BI Service.
Edit the security settings of the semantic model to add two users to the RLS role.
Manage security on your model
This way, the two users will each see only the report period of the corresponding controller when they log on.
If you need to test RLS on Power BI Desktop. Please refer to the following screenshot.
One final point to note:
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @David_Ramos ,
I did not reproduce your problem in my testing.
Below is my testing process.
The data table is shown below. Contains the UPN of two real users.
Set up the RLS model.
Create a measure to dynamically display the report period.
Ctrl_Period = IF(SELECTEDVALUE(uam_persona[controller])="Y",[ReportDraft],[ReportLive])
The designed local report is below.
Then publish to Power BI Service.
Edit the security settings of the semantic model to add two users to the RLS role.
Manage security on your model
This way, the two users will each see only the report period of the corresponding controller when they log on.
If you need to test RLS on Power BI Desktop. Please refer to the following screenshot.
One final point to note:
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.