Help with query: Get MAX value of rows that previous row has certain value
Make use of LAG analytic function

SELECT xID, MAX(xDATE),xValue FROM
(
SELECT t.*,
       CASE
            WHEN xvalue = 1 AND LAG(xvalue) OVER(
                 PARTITION BY xid
                 ORDER BY xdate
            ) = 0 THEN 1
            ELSE 0
       END
  AS cond
FROM test t
) s WHERE s.cond = 1
GROUP BY xID,xValue


Demo