Divide 2 metrics (ratio)

I have a dashboard with two questions

1st question shows the total count of active tickets
2nd question shows the count of active tickets not updated last seven days.

I have a 3rd question written in sql showing the ratio, using the other questions

WITH Counts AS (
SELECT
{{#112-second-question}} AS Count1,
{{#111-first-question}} AS Count2
)

SELECT
(CAST(Count1 AS FLOAT) / (Count2))
FROM Counts

I've now added a dashboard filter so I can see only tickets for selected organizational units and their manager groups.

question 1 & 2 respects the filter correctly, but the third question uses the 2 questions without the filter.

Can I pass the dashboard filter to the sql somehow, or can I get the ratio some other way without using sql?

Solved with a workaround

SELECT
CAST(
(SELECT COUNT()
FROM {{#66-eriks-uit-model}} AS model_alias
WHERE model_alias.sys_status_col10 IN ('Ej påbörjat','Pågående')
AND model_alias."Dagar sedan uppdatering" > 7
[[ AND {{enhet}} IS NOT NULL AND model_alias."Enhet" = {{enhet}} ]]
)
AS FLOAT)
/
(SELECT COUNT(
)
FROM {{#66-eriks-uit-model}} AS model_alias
WHERE model_alias.sys_status_col10 IN ('Ej påbörjat','Pågående')
[[ AND {{enhet}} IS NOT NULL AND model_alias."Enhet" = {{enhet}} ]]
) AS percentage