The structural, electronic, optical, and thermodynamic properties of Y $$_x$$ x Al $$_{1-x}$$ 1 - x N alloys were computed using first-principles calculations. The effects of exchange and correlation have been considered by means of the generalized gradient approximation (GGA) with the Perdew–Burke–Ernzerhof parametrization. In addition, the Tran–Blaha-modified Becke–Johnson potential (TB-mBJ) was applied to give a better description of the band-gap energies and optical spectra. The lattice parameters, bulk modulus, and band-gap energy show nonlinear dependence on concentration x. Results for rock-salt Y $$_x$$ x Al $$_{1-x}$$ 1 - x N alloys show that the band gap undergoes an indirect ( $$\Gamma \rightarrow X$$ Γ → X )-to-direct ( $$\Gamma \rightarrow \Gamma $$ Γ → Γ ) transition at a given yttrium composition, followed by a direct ( $$\Gamma \rightarrow \Gamma $$ Γ → Γ )-to-indirect ( $$\Gamma \rightarrow X$$ Γ → X ) transition in a higher yttrium concentration. For wurtzite Y $$_x$$ x Al $$_{1-x}$$ 1 - x N alloys, the band gap presents a direct ( $$\Gamma \rightarrow \Gamma $$ Γ → Γ )-to-indirect ( $$M\rightarrow \Gamma $$ M → Γ ) transition at a given yttrium composition, followed by an indirect ( $$M\rightarrow \Gamma $$ M → Γ )-to-indirect ( $$M\rightarrow \Sigma $$ M → Σ ) transition in a higher yttrium concentration. The real dielectric function, imaginary dielectric function, refractive index, and extinction coefficient were calculated using the TB-mBJ potential. Using a regular solution model, slightly lower mixing enthalpies for wurtzite Y $$_x$$ x Al $$_{1-x}$$ 1 - x N alloys were found. The mixing enthalpy for a given concentration differs depending on structures, and on the interaction between atoms of constituents. The effect of temperature on the volume, bulk modulus, Debye temperature, and the heat capacity for Y $$_x$$ x Al $$_{1-x}$$ 1 - x N alloys was analyzed using the quasi-harmonic Debye model. Results show that the heat capacity is fairly sensitive to composition as temperature increases.