Two Queries with different format in Grafana

You can edit the querys to:

SELECT
now() as time,
CAST(client as VARCHAR(50)) || "Y1" as metric,
MAX (ok_projects) as value
FROM
schema.table1
GROUP BY client;

And

SELECT
now () as time,
CAST(client as VARCHAR(50)) || "Y2" as metric,
COUNT (DISTINCT ko_projects) as value
FROM schema.table2
GROUP BY client;

And in the series override you can use regex in name of metrics
/.*Y1/
/. *Y2/