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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
bdn008
Advocate I
Advocate I

Toggle on user name as a filter like 'assigned to me' on/off with bookmarks

Hello,

 

I have been searching here and saw some old responses but was hoping that PBI had made some progress since. I am looking to Toggle on user name as a filter like 'assigned to me' on/off with bookmarks. RLS does not help me here.

 

I have a columns in my data with assignee details (name , email etc.) and I want to add a toggle option for every user to filter the table with "Assigned to me" or not. I already have RLS defined by regions and I still want the users to still see his/her region, if they choose while being able to temporarily filter on themselves.

 

1 ACCEPTED SOLUTION

how about this.  

show just mine.gif

 

This is a simulation using Adventure Works.

1. I have a table containing the countries that I am allowed to see, by placing the value returned by my username() into the table - on desktop for my demo.  

2. this table is connected to my territories table.

3. I wrote a measure that counts how many rows are in the territories table after I filter for my name using USERNAME()

 

MyRegions = VAR myCountry = CALCULATETABLE(VALUES(Territories[Region]), Access[User]=USERNAME())
return CALCULATE(COUNTROWS(Territories),KEEPFILTERS( myCountry))
 

4. I added this measure to the table that shows just my data as a filter >0

 

You know how to do the rest I guess.  I am sure you can adapt this to your needs.

https://www.dropbox.com/s/yuzoup6yfuy480f/show%20my%20regions.pbix?dl=1

 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

5 REPLIES 5
v-lid-msft
Community Support
Community Support

Hi @bdn008 ,

 

The bookmark can only save the Filter, but if you want to get the user name or email to filter data only assigned to them, you may need to use a measure, but the filter cannot use the dynamic measure value, so as a workaround you can publish a report and use the dynamic RLS rules to make people only see data assigned to them.

 

If it doesn't meet your requirement, You can come up a new idea and add your comments there to make this feature coming sooner. https://ideas.powerbi.com/forums/265200-power-bi-ideas

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks,

 

I am trying to keep the report agile and limiting using RLS is not going to work. Iam also awatre of the limits to filter on a measure and will add that to the backlog in the ideas.

 

I am still hoping that someone has a brilient idea how to toggle on the USERNAME() on a table that included the user email address. My understanding is that the services will have the user email address in the USERNAME() variable, and I can't but think it should be possible to compare and apply a filter. Just need some shared brilliance..

how about this.  

show just mine.gif

 

This is a simulation using Adventure Works.

1. I have a table containing the countries that I am allowed to see, by placing the value returned by my username() into the table - on desktop for my demo.  

2. this table is connected to my territories table.

3. I wrote a measure that counts how many rows are in the territories table after I filter for my name using USERNAME()

 

MyRegions = VAR myCountry = CALCULATETABLE(VALUES(Territories[Region]), Access[User]=USERNAME())
return CALCULATE(COUNTROWS(Territories),KEEPFILTERS( myCountry))
 

4. I added this measure to the table that shows just my data as a filter >0

 

You know how to do the rest I guess.  I am sure you can adapt this to your needs.

https://www.dropbox.com/s/yuzoup6yfuy480f/show%20my%20regions.pbix?dl=1

 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

A quick update - the solution Matt provided absolutely works per my question!

 

Was also to create a new measure to count regions based on the USERNAME().

 

 

 

Hi Matt,

I am really excited and optimistic by this approach and happy to see that brilliance is still an option here.. I will modify this approach to fit my needs. I am not sure yet but this shows a real potential being a viable approach. I will update here if I had issues.  

Of course I am extra happy to see my DAX (Supercharge Power BI) instructor from last year helping here – Thanks Matt.

 

Side note: I highly recommend his class and can say that after completing it, I was at a much higher level of DAX and Power BI (super) User. Its the least I can do for all his help as a token of appreciation.

https://exceleratorbi.com.au/power-bi-online-training/

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.