Forum Discussion
Filtering on a date range based on slicer value
Could someone please provide some insight...
I trying to find out why my filter is not working for the date range specified in the measure "Num of Events", and instead results are only displayed for the startDate.
Thanks!
Hi RichFlorida
Get a Date table with minimum Date and Start of Week columns. Create the relationship between 'Date'[DATE] and 'SearchTable'[COMPLAINT_DATE] and place 'Date'[Start of Week] in the slicer. Then a simple count aggregation will do.
- RichFlorida2 years ago
Helper V
Hi tamerj1 ,
Thank you for your post.
I already have a date table, the date on the slicer are the "start of week" dates.
I capture the selected "Start of week" date and use the measure below to get the count for a whole week.
However it is not working as the slicer value overrides my measure and force it to display total for the selected date/day only.
Pls advise!
Num of Events = var startDate = SELECTEDVALUE(SearchTable[COMPLAINT_DATE]) var endDate = startDate + 6 return CALCULATE( COUNTA( SearchTable[EVENT_NUMBER]) , (SearchTable[COMPLAINT_DATE] >= startDate && SearchTable[COMPLAINT_DATE] <= endDate) )