Forum Discussion
custom message row level security in power bi.. How to implement it in power bi
- 9 months ago
Hi Poojajunnu,
You can achieve this by following below steps:
Firstly check if the use has access to the report by checking user principle name with your table which has their email ids.
HasDataAccess =
IF(
ISFILTERED(SecurityUserMapping[UserEmail])
&& MAX(SecurityUserMapping[UserEmail]) = USERPRINCIPALNAME(),
1,
0
)Now create a measure AccessMessage =
IF (
[HasDataAccess] = 0,
"⚠ You are not authorized to view this data.",
BLANK()
)Now add this measure to a card visual and place on top of all visuals
and then turn off other visuals by adding HasDataAccess in filter pane by selecting 1 to show and 0 to hide.
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together! - 9 months ago
Hii Poojajunnu
Power BI does not allow custom pop-ups or messages directly through RLS. When RLS blocks all rows, visuals simply show blank. The only workaround is to create a DAX measure that checks when the user has no data and display a card with a custom message (e.g., “You do not have access to this data”). This is the only supported method to show a custom message with RLS.
RLS_Message = IF( ISFILTERED(YourTable[UserID]) && COUNTROWS(YourTable) = 0, "You do not have access to this data.", BLANK() ) - 9 months ago
Hi Poojajunnu ,
You can use ERRROR dax function to show error messages based on your RLS.
refer below link:
https://ocean-bi.com/2024/11/06/displaying-custom-error-messages-in-power-bi/
Please give kudos or mark it as solution once confirmed.
Thanks and Regards,
Praful
Hi Poojajunnu ,
May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.
Thank you.