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
I_Like_Power_BI
Helper II
Helper II

Dynamic Slicer Default Based on Top N

Hi all!

 

I have a report that uses RLS to determine whether someone has the data either a.) restricted to their data set, b.) restricted to their team data set, or c.) not restricted at all (admin access).  It works great!!

 

The problem is that my view is meant to filter down to one account only, otherwise it attempts to pull in millions of rows. I'm attempting to force one selection by defaulting an account on a slicer and selecting the "Only allow one selection" option.

 

What I'd like to do is have a slicer defaulted to the top account for a given user.  This works fine for group c (admins), who have access to every account.  For everyone else, this is what happens:

 

An account is defaulted that is (likely) not in the world of access for the user in group a or group b. They either go directly to the screen and see a blank, or they drill through from another page. If they drill through, the slicer stays on the old filtered account, while the drill through filter is on a different account.  I don't understand why this is happening, but it always results in a blank result:

Drill through filter doesn't affect the slicer on the pageDrill through filter doesn't affect the slicer on the page

 

So, what I'd like to do is select the Top 1 account in the slicer by whatever the user's world of accounts is. I need to be able to allow them to choose any of their other accounts, though, so filtering at the visual level wouldn't work.

 

Has anyone else solved this issue?

1 ACCEPTED SOLUTION

@I_Like_Power_BI , This column has all the values and one value default value. So means it will keep on getting all the values. Now has this column does not have account no for the first account

 

minx(allselected(Table),Table[Account]) 

Will give you the min Account number. You can use that measure in title to display the selected account No.

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

"view is meant to filter down to one account only, otherwise it attempts to pull in millions of rows"

 

Restrict the view to a reasonable size. Nobody ever scrolled past the first 1000 rows in any table visual.

@lbendlin - I think you misunderstood.  The view essentially restricts what you are looking at to one row only.  They need to be able to select from all of their potential accounts, though.  That data set is very large

amitchandak
Super User
Super User

@I_Like_Power_BI ,  Top N is only available at the visual level.

Maybe create a new column like this to select that.

new column =

If([Account] = min([Account]) ,"Default",[Account] & "")

 

And select the default, You cab show default no on a title 

@amitchandak - I understand the default measure you propose, but wouldn't I have to use that at the Visual level as a filter?  If so, that would limit the user to only seeing that one account, but it would also preclude them from selecting a different account if they needed to, no?

 

Also, I'm afraid I didn't understand this piece: 

 


@amitchandak wrote:

And select the default, You cab show default no on a title 




 

@I_Like_Power_BI , This column has all the values and one value default value. So means it will keep on getting all the values. Now has this column does not have account no for the first account

 

minx(allselected(Table),Table[Account]) 

Will give you the min Account number. You can use that measure in title to display the selected account No.

That did it.  Thanks!

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.