I've just been looking at the Kansas Adjutant Generals' Report from 1865 and it has a similar figure to that from Dyer's Compendium for Kansas. I believe the KS Adj Gen number is 20, 097. When you look at how this information is compiled, it appears not to be a total number of troops from Kansas, but the totals who responded to each call for troops. Some of the numbers are for three months troops, some for one year, some for militia, etc. Many of these men could have been counted two or three times, or more.
If you'd like to take a look at the KS Adj Gen Report with these numbers go to http://skyways.lib.ks.us/genweb/archives/statewide/military/civilwar/adjutant/i/statemen.html .
It would seem that these numbers and perhaps Dyer's may be unreliable for totaling the number of men who served in the Union army.