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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.