Aws-timestream in Grafana

Hello,
I’m using the aws-timestream datasource in grafana, and I want to get the duration of a specific measure_name when it was equal to ‘1’.
I didn’t find anything about how to do it! If someone could tell me if there’s a way to do so!
Best,