To reduce the discharge of the standard bulk Micromegas and GEM detector, the GEM-Micromegas detector was developed at the Institute of High Energy Physics. Taking into account the advantages of the two detectors, one GEM foil was set as a preamplifier on the mesh of Micromegas in the structure and the GEM preamplification decreased the working voltage of Micromegas to reduce the effect of the discharge significantly. At the same gain, the spark probability of the GEM-Micromegas detector can be reduced to a factor 0.01 compared to the standard Micromegas detector, and even the higher gain could be obtained. In the paper, the performance of the detector in X-ray beam was studied at 1W2B Laboratory of Beijing Synchrotron Radiation Facility. Finally, the result of the energy resolution under various X-ray energies was given in different working gases. It indicates that the GEM-Micromegas detector has the energy response capability in the energy range from 6 keV to 20 keV and it could work better than the standard bulk-Micromegas.