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.
Hi There!
Please consider this solution:
Step 1: Create a disconnected Calendar table in your data model All the calendar references in these measures must be to the disconnected table
Step 2 Date Slicer: Use the Drop Down slicer style with your date field but add other fields to make selection easier. Add Year, Quarter, Month, Date to the fields section of the date slicer and this will allow you to pick a specific date.
Step 3 Measure to select the date: Create a measure like this:
Selected Date = Max(Calendar[date]) --this grabs the max date in the selected context
Step 4 Add Date Measure:
AddOneMonth =
VAR _DateSelected = [SelectedDate]
VAR _AddOneMonth = CALCULATE( DATEADD( Calendar[Date], 1, MONTH ), Calendar[Date] = _DateSelected )
RETURN _AddOneMonth
Step 5 Criteria Measure:
MeetsCriteria =
SWITCH(TRUE(),
Table[Fecha] > [AddMonthToSelected] && Table[Vencimiento]< [AddMonthToSelected],
1, 0
)
Step 6: Add this column to your table visual and use the filter pane to filter to the value you are desiring
Thats the thing i wanted, but im having trouble with the step 5. The column you described at the step 5 is always false. Probably i did one of the previous steps wrong, but the measure of the steps 3 and 4 with its respective value seems okay, their values update in real time when i choose one or other option in the slicer.
- d_m_LNK6 months agoSuper User
Make sure that the correct comparisons are happening for the correct table. Also I think I forgot something in the last measure:
MeetsCriteria =
SWITCH(TRUE(),
SelectedValue(Table[Fecha]) > [AddMonthToSelected] && SelectedValue(Table[Vencimiento])< [AddMonthToSelected],
1, 0
)