Ultrasone sensor water level calculate

hay there i got an ultrasone sensor hooked up to an esp32 and it should detect the water level of my aquarium right now my tank is emptey not a drip of water in it and the sensor reads ultrasonic.sensor:040]: ‘Ultrasonic Sensor’ - Got distance: 0.352 m when i fill the tank up to what i want to be 100% it reads ultrasonic.sensor:040]: ‘Ultrasonic Sensor’ - Got distance: 0.034 m how would i go about turing this into % i got this

  - platform: ultrasonic
    trigger_pin: 32
    echo_pin: 35
    name: "Ultrasonic Sensor"
    unit_of_measurement: "%"
    accuracy_decimals: 0
    update_interval: 5s
    filters:
      - lambda: return ((0.36 - x + 0.006264) / (0.36 - 0.352)) * 100;

i want
where 0% = distance: 0.352 m
and 100% = distance: 0.034 m

Wouldn’t calibrate linear work fine for this?

i tryde it with this

    filters:
      - calibrate_linear:
          method: least_squares
          datapoints:
            - 0.0 -> 0.0
            - 50.0 -> 100.0

but its giving me a value of either 0% or 1% nothing in between and the werid thing for me is that if i get close to the sensor its 1% and if i get further away its 0%

Why did you do that?
You should use the values you have.

filters:
      - calibrate_linear:
          method: least_squares
          datapoints:
            - 0.352 -> 0
            - 0.034  -> 100

to be honest i have no idea why i grabbed those numbers i thought i neededt to calculate how big my container was well how tall this worked so yay and thans