Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

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

 

dd_55_1-1637682726137.png

 

 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
 
dd_55_2-1637682996728.png

 Without RLS the counts for the site are correct.

dd_55_3-1637683061395.png

 

@PBICommunity - Can someone help

1 ACCEPTED SOLUTION
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.

View solution in original post

2 REPLIES 2
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.

amitchandak
Super User
Super User

@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) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.