Forum Discussion

jmkvalsund's avatar
jmkvalsund
Icon for Helper III rankHelper III
3 years ago
Solved

How do I filter the limits in a slicer?

I'm trying to limit the data showing in a report to be only the current viewers data.
I've managed that by applying a measure, CurrentUserName = USERPRINCIPALNAME() 

Then I filter the visuals by this measure,
I.e. creating a measure SalesSum and then creating a new measure like
SalesSumCurrentUser=CALCULATE('Sales'[SalesSum] ,FILTER('Users' ,'Users'[email]=[CurrentUser])
Works fine.

But when I apply a "between"-slicer to the visuals, I'm not able to get the limits of the slicer to just show the current users max- and min value. It shows the range of the whole table. How can I apply a filter to the values defining the slicer? 

  • Shaurya's avatar
    Shaurya
    3 years ago

    Hi jmkvalsund,

     

    I suggest you create a new table which is filtered dynamically by using something like this:

     

    Custom Slicer = FILTER('Table','Table'[Value]>=[Min LoggedIn] && 'Table'[Value]<=[Max LoggedIn])

     

    Works for you? Mark this post as a solution if it does!

3 Replies

  • Shaurya's avatar
    Shaurya
    Icon for Memorable Member rankMemorable Member

    Hi jmkvalsund,

     

    Try creating two measures for calculating the maximum and minimum value in your range for the logged in user.

     

    You can use:

     

    Max LoggedIn = CALCULATE(MAX('Table'[Values]), FILTER('Users','Users'[Email] = [CurrentUser])

     

    Min LoggedIn = CALCULATE(MIN('Table'[Values]), FILTER('Users','Users'[Email] = [CurrentUser])

     

    Use these two measures as filters for your slicer.

     

    Works for you? Mark this post as a solution if it does!

    • jmkvalsund's avatar
      jmkvalsund
      Icon for Helper III rankHelper III

      Hi Shaurya,
      Thanks for your reply. 
      How do I make these measures filters on the slicer? The values are correct, but I dont see how I can attach them to the slicer?

      • Shaurya's avatar
        Shaurya
        Icon for Memorable Member rankMemorable Member

        Hi jmkvalsund,

         

        I suggest you create a new table which is filtered dynamically by using something like this:

         

        Custom Slicer = FILTER('Table','Table'[Value]>=[Min LoggedIn] && 'Table'[Value]<=[Max LoggedIn])

         

        Works for you? Mark this post as a solution if it does!