Using density functional theory (DFT) methods, we have calculated X-ray absorption spectroscopy (XAS) and X-ray circular dichroism (XMCD) spectra in bulk and thin films of Fe$_3$GeTe$_2$, CrI$_3$, and CrGeTe$_3$. DFT+$U$ methods are employed for better handling of correlation effects of 3$d$ electrons of transition metals. We discuss relations between the density of states, radial matrix elements, and the corresponding spectra. By comparing the calculated spectra with previously measured spectra, we discuss the reliability of DFT+$U$ methods to describe the electronic structures of these materials and determine the corresponding optimal $U$ and $J$ parameters.