Some mathematical comments that may let you figure out ahead of time whether that will work:First I will try and slope it up 45, but if I don’t have the room/elevation I’ll have to route it as you drew it up
A flat wye puts the vent at an inadequate slope (2%, say), but at a 45 degree angle as seen from above. If you roll the wye 90 degrees to have the branch at its highest point, you'd have a 45 degree slope, but no angle as seen from above. Which would mean if the trap arm is running parallel to the wall, you'd never make progress towards the wall.
So you can roll the wye up just 45 degrees. That gives you a 30 degree slope, which is considered adequate, but as seen from above your angle is only 35 degrees from the trap arm. The vent will move 1" towards the wall as it rises 1" vertically.
The upshot is that if your distance from the wall is less than your distance below the floor (possibly minus the pipe diameter, that bears a little thought), you should be able to use a wye rolled 45 degrees off a trap arm parallel to the wall. The vent will need a 60 degree bend to turn vertical into the wall.
One other thing you could try is pointing the trap arm at a 45 degree angle away from the wall, and immediately hitting a wye rolled up 45 degrees. That will put the vent pointed towards the wall (just 10 degrees off directly towards the wall as seen from above), and the vent will move 1.7" towards the wall as it rises 1". You will end up starting the vent farther from the wall, but depending on how far below the floor your trap arm is, it may be more than made up for by the more direct progress towards the wall.
A final important point is to point the trap u-bend towards the wall, and then point the trap elbow outlet at the desired direction. A 2" trap actually helps you here, as the u-bend is a little wider.