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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors