Forum Discussion

I_Like_Power_BI's avatar
6 years ago
Solved

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

  • amitchandak's avatar
    amitchandak
    6 years ago

    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.

6 Replies

  • 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 

    • I_Like_Power_BI's avatar
      I_Like_Power_BI
      Icon for Helper II rankHelper II

      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 




       
      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

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

    • I_Like_Power_BI's avatar
      I_Like_Power_BI
      Icon for Helper II rankHelper II

      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