Dashboard filter summarised data on underlying model

I've created a question that summarises rows in my model using, among other things, count. I need to be able to filter the data by date range such that, for example, selecting 1 week shows the count of rows where the created_at field is within that week.

This is easy when I create a visualisation from the question itself. Choosing 'Filter' here gives me a list of all of the columns in the original model. But when I try to connect a date range filter in the dashboard to this question in the dashboard, it says that no column is available to link to. It seems that in the dashboard context, only the columns in the final question output are available. Why the discrepancy between the question view and the dashboard view?

Is this using a custom SQL query?

Hi Andrew, no I've built the question using the UI based on my model (which is written in SQL).

I was able to solve this by learning how to use custom SQL field filters. It's a shame you can't get the same level of filtering power in a dashboard as you can in the question visualisation when using the GUI to create questions, but custom SQL makes it possible to go around this.

For the record, I added a custom variable in for my date which I added to a where clause before any aggregation runs in my query. I was then able to target this variable in my dashboard date filter.