I might have something for you.

If you redo the drawing a bit.

Let $x_2$ be the height of your shape up to the point of the circular sector.

Then let

$h=y-x_2$

According to

this
The area of the circular segment is given by

$a_{seg}=r^2 \cos ^{-1}\left(\dfrac{r-h}{r}\right)-(r-h) \sqrt{2 h r-h^2}$

The rectangular area is just

$a_{rect}=x x_2$ so the total area is

$\large z=a_{rect}+a_{seg}=r^2 \cos ^{-1}\left(\frac{r-h}{r}\right)-(r-h) \sqrt{2 h r-h^2}+ x x_2$

Solving this equation in terms of x I get

$x=\frac{z+r^2 \left(-\cos ^{-1}\left(\frac{r+x_2-y}{r}\right)\right)+r \sqrt{-(x_2-y) (2 r+x_2-y)}-y \sqrt{-(x_2-y) (2 r+x_2-y)}+x_2 \sqrt{-(x_2-y) (2 r+x_2-y)}}{x_2}$

I'd double and triple check this but it's possible that it will work.