Forum Discussion
Slicer date range issue
- Anonymous3 years ago
Hi Suryateza ,
Please try below steps:
1. below is my test table
Table:Date:
Date = CALENDAR(DATEVALUE("2023/07/01"),DATEVALUE("2023/07/20"))2. create a measure with below dax formula
Measure = VAR min_date = MIN ( 'Date'[Date] ) VAR max_date = MAX ( 'Date'[Date] ) VAR cur_arr = SELECTEDVALUE ( 'Table'[Arrived] ) VAR cur_dep = SELECTEDVALUE ( 'Table'[Departed] ) VAR result = SWITCH ( TRUE (), cur_arr >= min_date && cur_dep <= max_date, 1, cur_arr < min_date && cur_dep >= min_date && cur_dep <= max_date, 1 ) RETURN result3. add a table visual with Table fields, add a slicer visual with Date table, add measure to table visual filter pane and apply
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Suryateza ,
Please try below steps:
1. below is my test table
Table:
Date:
Date = CALENDAR(DATEVALUE("2023/07/01"),DATEVALUE("2023/07/20"))
2. create a measure with below dax formula
Measure =
VAR min_date =
MIN ( 'Date'[Date] )
VAR max_date =
MAX ( 'Date'[Date] )
VAR cur_arr =
SELECTEDVALUE ( 'Table'[Arrived] )
VAR cur_dep =
SELECTEDVALUE ( 'Table'[Departed] )
VAR result =
SWITCH (
TRUE (),
cur_arr >= min_date
&& cur_dep <= max_date, 1,
cur_arr < min_date
&& cur_dep >= min_date
&& cur_dep <= max_date, 1
)
RETURN
result
3. add a table visual with Table fields, add a slicer visual with Date table, add measure to table visual filter pane and apply
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.