Forum Discussion
Filter Slicer from Measure values
I wonder if the problems are to do with it being the date table we're trying to filter. Instead of using IN you could try
Date is visible =
IF (
SELECTEDVALUE ( 'Date'[Date] ) >= [2 Step]
&& SELECTEDVALUE ( 'Date'[Date] ) <= [1 Step],
1,
0
)
Hi johnt75,
Tried and still not working.
Sharing a sample file for you to play around it if you will.
I tried this technique as well, but didn't seem to work. Have a look at it.
Create slicer with Custom Time Periods in PowerBI | Time Intelligence | MiTutorials - YouTube
Thank you!
- johnt753 years agoSuper User
Is Visible = VAR CurrentDate = MAX('Calendar'[Date]) VAR Step1 = [1 Step] VAR Step2 = [2 Step] RETURN IF( CurrentDate >= Step2 && CurrentDate <= Step1, 1, 0)gives the correct values in the table, but it doesn't play nicely with the slicer. If I add it as a filter on the slicer then you can't select any dates at all. Not sure what's going on.
- lbendlin3 years agoSuper User
Show your data model/post a sample pbix. Most likely the calendar table needs to be disconnected.
- visheshjain3 years agoImpactful Individual
Hi lbendlin,
I have shared a sample file in message 13 of the thread. Sharing it again in this post.
If the calendar table is diconnected, then it will not be able to filter out data from the fact tables.
Here is a look at the data model. It is quite basic.
- lbendlin3 years agoSuper User
Your measure are a little too complex. Use these instead:
1 Step = EOMONTH(CALCULATE ( MAX ( 'Sales'[Sale Date] ), ALL () ),-1) 2 Step = EOMONTH([1 Step], - [Parameter Value] ) + 1 - visheshjain3 years agoImpactful Individual
Hi lbendlin,
Changed the measures but still, its not working with filtering the slicer.
Attaching my file again.