Electronic structure for BKB has been calculated by using LMTO-ASA-Supercell method based on the X-ray absorption fine structure (XAFS) spectroscopy measurements. Measurements show that Bi posseses two valence states Bi3+ and Bi5+ and their Bi—O bond lengths are diffferent, the difference decreases with the increase of K concentration. Calculations are performed on five samples namely Ba4Bi4O12(404),(Ba3K)Bi4O12(314),(BaK)Bi2O6(112),(BaK3)Bi4O12(134),K2Bi2O6(022).Results from the calculations show that (404)and (314)are semiconductors with gaps of 1.6eV and 1.5eV, respectively. Other samples are metals. Total energy analysis shows that (314) is not stable, so that the extreme value of x is 0.5. The BKB electronic structures at x=0.1 to 0.5 are calculated by combining the probability with sample's Bernoull's distribution. Superconducting transition temperature Tc of BKB is suddenly changed when x approximates to 0.25. The experimental data are close to the prediction values of percolation theory.