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! Learn more

Reply
vnanduri
Frequent Visitor

View Slicer information measure, not working when implemented with "RLS"

Hi Team,

 

I have built a measure which displays my slicer selection at any given time. For this example, I have chosen Australian cities as my slicer options.

What the measure does is  a. when no city is selected, it displays a value that data is showing for "All Cities" and b. when one or more (but not all) cities are selected, it shows the list of all the cities which are selected.

 

a.  

vnanduri_0-1594889208537.png

b.

vnanduri_1-1594889603561.png

 

The measure that I have used is 

Measure = IF(ISFILTERED(Table_Name[Column_Name]), CONCATENATEX( VALUES(Table_Name[Column_Name]), [Column_Name], ", "), "All Cities")


It works fantastic under normal conditions but not when RLS is implemented.

For example, if I create a role which has the ability to view records specific to "Adelaide" and I view the report as that specific role, my measure still displays the slicer choice as "All Cities". (refer to screen shots below)Show_Slicer_1.PNGShow_Slicer_2.PNG
How do I get around this? My objective is when a user who belongs to the security group "Adelaide" logs in to view the report, he/she should automatically view the information on the Card "Data Showing for the City" as "Adelaide" .

It would be awesome if someone could help me out with this!

Thanks,
VJ
1 ACCEPTED SOLUTION

Hi @vnanduri,

 

Sorry for the late reply.

Yes,it is available,see steps below:

First,create a calculated column to the total number for distinct value in column 1:

Distinctcount total = CALCULATE(DISTINCTCOUNT('Table'[Column1]),ALL('Table'))

Then create a measure as below:

Measure = 
var a =DISTINCTCOUNT('Table'[Column1])
Return
IF(a=1,MAX('Table'[Column1]),IF(a>1&&a<MAX('Table'[Distinctcount total]) ||ISFILTERED('Table'[Column1]), CONCATENATEX( VALUES('Table'[Column1]),[Column1], ", "), "All Cities"))

And you will see:

Annotation 2020-07-24 092821.png

Pls see attached for details.

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

5 REPLIES 5
v-kelly-msft
Community Support
Community Support

Hi @vnanduri

 

It is because RLS is applied in the data model,so when you are using RLS,the column is being filtered as set in RLS,but in your measure ,only when the data is selected in the slicer,then it will show as the data in the slicer,that's why it is showing "all cities".(As none value is selected currently)

You need to modify your measure as below:

Measure = 
var a =DISTINCTCOUNT('Table'[Column1])
Return
IF(a=1,MAX('Table'[Column1]),IF(ISFILTERED('Table'[Column1]), CONCATENATEX( VALUES('Table'[Column1]),[Column1], ", "), "All Cities"))

Then you will see:

Annotation 2020-07-17 151419.png

 

Check the attachment for details.

 

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Hi Kelly, (@v-kelly-msft ) 


Thank you for this. This works perfect for me.

 

One additional thing I was wondering is how do I get the Card visual to display information if the RLS role has more than one access.

 

For example, in the file that you have provided me, "New Role" has the ability to view info for only "a". If the role allows me to view information for "a" as well as "q", the measure displays "All Cities". What I want is it to display "a, q".

vnanduri_0-1595375384382.png

 

Is this possible?

 

Thanks,
Vijay

Hi @vnanduri,

 

Sorry for the late reply.

Yes,it is available,see steps below:

First,create a calculated column to the total number for distinct value in column 1:

Distinctcount total = CALCULATE(DISTINCTCOUNT('Table'[Column1]),ALL('Table'))

Then create a measure as below:

Measure = 
var a =DISTINCTCOUNT('Table'[Column1])
Return
IF(a=1,MAX('Table'[Column1]),IF(a>1&&a<MAX('Table'[Distinctcount total]) ||ISFILTERED('Table'[Column1]), CONCATENATEX( VALUES('Table'[Column1]),[Column1], ", "), "All Cities"))

And you will see:

Annotation 2020-07-24 092821.png

Pls see attached for details.

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Hi Kelly, @v-kelly-msft 

That did its magic. Thank you so much for your help.

 

Cheers,

VJ

amitchandak
Super User
Super User

@vnanduri , not sure I got it

 

City = if(ISFILTERED(Geography[City]),CONCATENATEX(distinct(Geography[City]) ,Geography[City] &" "),"All")

 

City = if(ISFILTERED(Geography[City]),max(Geography[City] ),"All")

 

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors