Forum Discussion
Dynamic Complex Filtering with slicers
- 6 months ago
Hi Jan03,
Please find the attached PBIX file below. I hope it meets your requirements.
Kindly review it and let me know if you need any further adjustments or clarifications. If the issue still persist please share a sample PBIX file with sample output.
Thank you.
1) Create a slicer table (disconnected)
Use a date table just for the slicer (it must not relate to the fact table):
SlicerDate =
CALENDAR ( DATE(2020,1,1), DATE(2035,12,31) )
Put SlicerDate[Date] on a slicer.
2) Create a measure that flags valid fact rows
InRange (row) =
VAR SelDate = SELECTEDVALUE ( SlicerDate[Date] )
VAR SelPlus1 = EDATE ( SelDate, 1 )
VAR Venc = MIN ( Fact[Vencimiento] )
VAR Fec = MIN ( Fact[Fecha] )
RETURN
IF (
NOT ISBLANK ( SelDate )
&& SelPlus1 >= Venc
&& SelPlus1 < Fec,
1,
0
)
3) Apply it to visuals
For each visual you want to filter:
-
Drag InRange (row) into the visual-level filters
-
Set it to is 1
This will make the visual only show records where:
SelectedDate + 1 month >= Vencimiento and SelectedDate + 1 month < Fecha
Thanks, but it doesnt work. I did exactly what you said. Probably i made a mistake in the medium steps. And the problem isn't the data.
- d_m_LNK6 months agoSuper User
I think the only issue is that your initial variable is potentially pointed to the calendar table that has a relationship to the fact table and not the disconnected SlicerDate[Date] table you created for the slicer.
- Jan036 months agoFrequent Visitor
I cant see a relationship between tables. The calendar table (which creates the slicer) is apart.