Catalyzes the transfer of sulfate to position 4 of the N-acetylgalactosamine (GalNAc) residue of dermatan sulfate. Plays a pivotal role in the formation of 4-0-sulfated IdoA blocks in dermatan sulfate. Transfers sulfate to the C-4 hydroxyl of beta1,4-linked GalNAc that is substituted with an alpha-linked iduronic acid (IdoUA) at the C-3 hydroxyl. Transfers sulfate more efficiently to GalNAc residues in -IdoUA-GalNAc-IdoUA- than in -GlcUA-GalNAc-GlcUA-sequences. Has preference for partially desulfated dermatan sulfate. Addition of sulfate to GalNAc may occur immediately after epimerization of GlcUA to IdoUA. Appears to have an important role in the formation of the cerebellar neural network during postnatal brain development. n 3'-phosphoadenylyl sulfate + dermatan = n adenosine 3',5'-bisphosphate + dermatan 4'-sulfate + n H(+) Low levels of expression in olfactory bulb, caudate putamen, cerebral cortex, hippocampus, thalamus, midbrain and cerebellum during early postnatal development. In later stages, exclusively expressed in cerebellum culminating at P14 of postnatal development. Belongs to the sulfotransferase 2 family.