The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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?
Solved! Go to Solution.
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!
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!
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?
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!