That feels weird.
I created a very minimal test just to be sure the custom time was working:
# Clean up
DELETE discuss-342090
# Create index
PUT discuss-342090
{
"settings": {
"number_of_replicas": 0
},
"mappings": {
"properties": {
"expiry": {"type": "date"}
}
}
}
# Add some data in the past and the future
POST discuss-342090/_bulk
{ "index": {} }
{ "expiry": "2023-09-01" }
{ "index": {} }
{ "expiry": "2023-09-01" }
{ "index": {} }
{ "expiry": "2023-09-01" }
{ "index": {} }
{ "expiry": "2023-09-10" }
{ "index": {} }
{ "expiry": "2023-09-10" }
{ "index": {} }
{ "expiry": "2023-09-10" }
{ "index": {} }
{ "expiry": "2023-09-10" }
# Create a Kibana Data View
POST kbn:/api/data_views/data_view
{
"data_view": {
"title": "discuss-342090",
"timeFieldName": "expiry"
}
}
And created a dashboard with the same count metric with custom time ranges in the past and future, all working as expected.
So at this point, if you could share some example data similarly to the way I did so we can try to reproduce the issue and investigate further, maybe we can open an issue in the Github repository.
Hope it helps.