Energy shifts in K X-ray peaks of potassium and calcium in different chemical compounds have been determined from their X-ray spectra recorded in an energy dispersive X-ray fluorescence (EDXRF) set-up. The set-up comprises low-power X-ray tube photon source and Si(PIN) detector (AMPTEK model XR-100 CR). A statistical procedure has been followed to determine the shifts and t-test was applied to find the statistical significance of the results. The shifts were determined in potassium compounds; KCl, KBr, KI, K2CO3, K2Cr2O7, K2CrO4, K2SO4, K3Fe(CN)6, K4Fe(CN)6, KHSO4, KMnO4 and KSCN with KNO3 as reference and in calcium compounds; Ca(NO3)2 · 4H2O, Ca(OH)2, CaCl2, CaCO3, CaSO3 and CaSO4 · 2H2O with CaO as reference and correlated with differences in electro-negativity, number of ligands, structural changes, type of bonding, axial distances, etc. in the compounds. The shifts in potassium compounds have been evaluated for the first time while the same for calcium compounds almost agree well with the earlier reported measurements in literature.