Combine two queries - Icinga2 -> InfluxDB -> Grafana

In before I am quite new to Grafana / Icinga2 / InfluxDB.

I have two dhcp servers. I have two services that check for all used ip addresses on this servers.
In Grafana I try to display the sum of both values as line graph over time to have all free ip addresses and in a second step all unused ip addresses.

The checks are up and running and I finally made it to display used/free ip addresses as line graph for each check seperately.

Now I want to sum the returned values by both checks and display them in one graph, but I do not know how to manage that since the checks are asynchroun and I do not know how to join two queries.

This are my working queries:
Graph1:
1: SELECT value AS IPsInUse FROM "check_dhcp_free_nrpe" WHERE $timeFilter AND hostname='hostA'
2: SELECT max AS IPs "check_dhcp_free_nrpe" WHERE $timeFilter AND hostname='hostA'

Graph2:
1: SELECT value AS IPsInUse FROM "check_dhcp_free_nrpe" WHERE $timeFilter AND hostname='hostB'
2: SELECT max AS IPs "check_dhcp_free_nrpe" WHERE $timeFilter AND hostname='hostB'

How may I connect the two graphs to sum add “value”-values as well as both “max”-values and display them in one line graph.
I tried it with “group by time(1m)”, since the checks are running every minute, but somehow this produces me some glitches:

E.g.: for “IPsInUse”

I hope you could understand my problem and hope someone can help me.