Forum Discussion
Filtering a visual to display data for dates prior to min date of date range filter
- 2 years ago
Hi Usefulinfo - To achieve this, you can avoid using REMOVEFILTERS by focusing on maintaining the date context from the filter visual. Instead of removing filters, we can use ALLSELECTED with a condition to include only dates earlier than the minimum selected date in the filter
ShowApplication =
VAR MinFilterDate =
CALCULATE(
MIN('Date Table'[Date]),
ALLSELECTED('Date Table')
)
RETURN
CALCULATE(
COUNTROWS('App'),
KEEPFILTERS('App'[Received_Date] < MinFilterDate)
)hope this gives you correct app count with date filter. please check
- 2 years ago
Usefulinfo since you use ReceivedDate as Key column for Calendar relationship, modify your solution to this:
CALCULATE( COUNTROWS('Sheet2'), DateTable[Date] < StartDate, -- the change is here, using Date column from calendar instead RecievedDate -- and also here, since it's different table you have to add these filter as new parameter, so split by comma ISBLANK('Sheet2'[Despatch_Date]) && 'Sheet2'[Status] <> "close" ) - 2 years ago
Yes, I have all these details. I have tested again and its working fine.
Thank you so much for your help.
rajendraongole1 , thank you for your reply. I tried this as well but it give blank result for condition 'App'[Received_Date] < MinFilterDate.
Its showing correct result for greater condition.
'App'[Received_Date] > MinFilterDate.
Could you please suggest to fix this for 'App'[Received_Date] < MinFilterDate. as well?
- rajendraongole12 years ago
Super User
Hi Usefulinfo - To troubleshoot and ensure that only records with Received_Date less than MinFilterDate are counted. slight update on previous measure. please check below one. using ALLSELECTED
ShowApplication =
VAR MinFilterDate =
CALCULATE(
MIN('Date Table'[Date]),
ALLSELECTED('Date Table')
)
RETURN
CALCULATE(
COUNTROWS('App'),
FILTER(
ALLSELECTED('App'),
'App'[Received_Date] < MinFilterDate
)
)