Forum Discussion
Reverse Filter Measure not working
Hello Community,
I'm an Inventory Items table that contains, amount other fields, Item ID, Description and Last Movement Date. I'm trying to get the a date slicer to give me the items OUTSIDE the selected dates. I have the following Measure.
Reverse Date Measure =
VAR SelectedMinDate = MIN(Date_Helper[Date])
VAR SelectedMaxDate = MAX(Date_Helper[Date])VAR DebugCheck = IF(
ISBLANK(SelectedMinDate) || ISBLANK(SelectedMaxDate),
"No Slicer Selection",
"Slicer Active"
)RETURN
IF(
DebugCheck = "No Slicer Selection",
DebugCheck,
CALCULATE(
COUNTROWS('Item Master'),
ALL(Date_Helper), -- Remove date slicer context temporarily
'Item Master'[Last_Movement_Date] < SelectedMinDate || 'Item Master'[Last_Movement_Date] > SelectedMaxDate,
NOT(ISBLANK('Item Master'[Last_Movement_Date]))
)
)
If the slicer is based on a Date_Helper table, ensure that it is properly linked to your Item Master table by the Last_Movement_Date field.
3 Replies
- Kedar_PandeSuper User
Reverse Date Measure =
VAR SelectedMinDate = MIN(Date_Helper[Date])
VAR SelectedMaxDate = MAX(Date_Helper[Date])VAR DebugCheck = IF(
ISBLANK(SelectedMinDate) || ISBLANK(SelectedMaxDate),
"No Slicer Selection",
"Slicer Active"
)RETURN
IF(
DebugCheck = "No Slicer Selection",
DebugCheck,
CALCULATE(
COUNTROWS('Item Master'),
ALL(Date_Helper), -- Remove date slicer context temporarily
'Item Master'[Last_Movement_Date] < SelectedMinDate || 'Item Master'[Last_Movement_Date] > SelectedMaxDate,
NOT(ISBLANK('Item Master'[Last_Movement_Date]))
)
)
If the slicer is based on a Date_Helper table, ensure that it is properly linked to your Item Master table by the Last_Movement_Date field. - AnonymousNot applicable
Hi jflores ,
-- I have my Item Table Linked to my Date_Helper Table.
My suspicion is that the problem lies here.
The filter from the slicer:
MIN(Date_Helper[Date]) <= Date_Helper[Date] && MAX(Date_Helper[Date]) >= Date_Helper[Date]The filter from the dax:
'Item Master'[Last_Movement_Date] < MIN(Date_Helper[Date]) ||'Item Master'[Last_Movement_Date] > MAX(Date_Helper[Date])These two filters have no intersection, and under their combined effect (AND), 'Item Master' will not return any records.
Please try disconnecting the relationship between the Item Table and the Date_Helper Table.
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- jfloresFrequent Visitor
Thank you. This changed worked.