PWM shunt current measurement

You could add a capacitor to smooth out the voltage on the shunt, although it may also affect the voltage reading,
Or take many reading fast and find the ones that count, mind you may also want adjust in software that the duty cycle varies so the avg current is different than at the instant its on
or add a capacitor and or inductor to the output to smooth the voltage and keep the current constant