We present an X-ray absorption spectroscopy (XAS) study performed at both the Fe K-edge and rare-earth L-1,L-3-edges; of the R1-xRx'(Fe1-yAly)(2) series (R = Ho, Er and R' = Lu, Y). We show that substitution of the rare-earth (Ho, Er) by a non-magnetic one (Y, Lu) acts as a simple magnetic dilution effect. In contrast, the magnetic properties of these systems are drastically changed when Fe is substituted by the non-magnetic Al, independently of the rare-earth involved. The combined study of the different regions of the absorption spectra for the different atomic species in these materials allow us to disentangle the structural and electronic effects of the substitution. Our results reveal that the change of the magnetic properties upon Al substitution are triggered by the strong modification of the density of states (DOS) which also affects the R(5d)-Fe(3d) hybridization.