How to transform values from influx to grafana

I use icinga2+influx+grafana for monitoring and for a specific measurement, icinga stores device status 0 for UP and 3 for unknown (which in my scenario means DOWN).

The problem I’m facing is the graph on grafana looks like this for a UP device:

which sounds the opposite. So my question is:
Is there a way to transform this value to something like (UP = 1 / DOWN = 0) for producing a more-intuitive graph?

Any help would be appreciated