Grouping the Vehicle_Speed by BCM_Commandmodes(Dont have any Tags in Measurements)

This is the query i have written but not getting the Proper graph For this.
import “experimental”

from(bucket: “Grafana_Bucket”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == “MAY_4_New _Regen_Switch_logic_V24_fixed_portable”)
|> filter(fn: (r) => r._field == “Vehicle_Speed” or r._field == “BCM_ModeCommand”)
|> max(column: “_value”)
|> map(fn: (r) => ({
_time: r._time,
_field: if r._field == “BCM_ModeCommand” then
if r._value == 1.0 then “Sonic”
else if r._value == 2.0 then “Ride”
else if r._value == 3.0 then “Dash”
else “Eco”
else r._field,
_value: r._value
|> group(columns: [“_field”])
|> yield(name: “max_speed”) i am using this query but not getting proper graph

How to get the proper Grapgh for all command modes which is grouped by vehicle_speed