You measure sugar differently depending on the type you are using.

Brown sugar is always packed tightly into the measuring cup and leveled off with a knife.
Brown sugar needs to be packed since it has more air in it than granulated sugar. So to get an accurate measure you need to pack it.

Granulated sugar is scooped and leveled off with a knife.

Powdered sugar should be spooned into a measuring cup and than leveled off with a knife.
Scooping it may cause it to get somewhat packed in and you want the powdered sugar to be fluffy and light in the cup.
That is the same reason you don’t want to shake the cup to remove excess.
It will cause the powdered sugar to settle and you may end up adding more to the recipe than was intended.