Power Trick and Power Split (plus Guard Split and Speed Swap for other stats) are unique in that they change the values at the level of *raw stats*. You take raw stats into account before any modifiers such as Pure Power, so if the raw stats are normally 96/107 (with Pure Power doubling the 96 to 192), Power Trick changes it so that the raw stats are temporarily counted as 107/96, so Pure Power now doubles the 107 instead and turns it into 214.

If Medicham had a +1 attack modifier as well, you apply that before Pure Power. From 96, +1 gets you to 144, then Pure Power doubles to 288; from a Power Tricked 107, +1 goes to 160 (you have to round the fractional part down), then double to 320 (instead of 321 which you would get if Pure Power applied before a +1, or 322 if the fraction rounded up).