Value Mappings based on 2 Queries

Grafana V9.4.3

Hi to all
i want to create a panel that will have 2 entries from my database table (both can have 2 values only 0 or 1 )
So i would like to check both of them if they are 0 and then my templating will display a custom value mapping.

can be done ?

i have used in the past the classic condition as an operation for create alert