Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

RLS Changing the Count Measure Value

Hello,

 

I have a report which brings data from tables merged together as 1 using INNER JOIN.

 

The main table is - SiteMembership

 

 

 I need to Count the SiteMapId from SiteMembership where Group Id = 2

Query: SELECT COUNT (*) FROM dbo.SiteMembership WHERE  GroupID = 2

 

DAX Written: 

Client Count =
VAR V1 = CALCULATE(COUNT(SiteMembership[SiteMapID]),SiteMembership[GroupID]=2)
RETURN IF( V1 = 0, 0, v1)
 
This works fine without RLS which is on the SiteMembership table on UserPrincipalName and SiteMgr = TRUE()
 
But when security is applied the Counts become 0 and for the site The counts become 0
 

 Without RLS the counts for the site are correct.

 

PBICommunity - Can someone help

  • Anonymous's avatar
    Anonymous
    4 years ago

    amitchandak Thanks, I resolved it myself. The issue was that the bridge table for dynamic RLS was not created and hence it was directly applying the filters on the main table.

2 Replies

  • Anonymous ,what should happen with RLS.

     

    I think you should use a measure like

     


    Client Count =
    VAR V1 = CALCULATE(COUNT(SiteMembership[SiteMapID]),filter(SiteMembership, SiteMembership[GroupID]=2) )

  • Anonymous's avatar
    Anonymous
    Not applicable

    amitchandak Thanks, I resolved it myself. The issue was that the bridge table for dynamic RLS was not created and hence it was directly applying the filters on the main table.