Forum Discussion

Poojajunnu's avatar
Poojajunnu
Frequent Visitor
9 months ago
Solved

custom message row level security in power bi.. How to implement it in power bi

custom message row level security in power bi.. How to implement it in power bi
  • grazitti_sapna's avatar
    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!

  • rohit1991's avatar
    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()
    )