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
chrisw14
New Member

Number of rows with row-level security filter

Hi,

I would like to ask for your help for the following simplified scenario:

There is a table CITIES and a table COUNTRIES and I want to show the cities or countries in a map if the user has access rights (based on row-level security filter) for these cities / countries.

The map should represent cities if the current user has access to less than 5 cities. Otherwise the map should show the countries.

Therefore I tried the following measures but unfortunately the number of rows is always wrong:

 

CountryOrCity1 = If([CountRows(CITIES)] > 5; CALCULATE(MAX(COUNTRIES[COUNTRY_NAME])); CALCULATE(MAX(CITIES[CITY_NAME])))

CountryOrCity2 = If([CountRows(ALL(CITIES))] > 5; CALCULATE(MAX(COUNTRIES[COUNTRY_NAME])); CALCULATE(MAX(CITIES[CITY_NAME])))
CountryOrCity3 = CALCULATE(If([CountRows(CITIES)] > 5; MAX(COUNTRIES[COUNTRY_NAME]); MAX(CITIES[CITY_NAME])))

CountryOrCity4 = CALCULATE(If([CountRows(ALL(CITIES))] > 5; MAX(COUNTRIES[COUNTRY_NAME]); MAX(CITIES[CITY_NAME])))

 

Can you please tell me how the number of rows is calculated in the right way?

 Thank you in advance.

1 REPLY 1
chrisw14
New Member

Does anyone have an idea for this problem? Thank you.

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