Measure with another piece of wood (if you want to be accurate use a tape measure) and measure how far you want the desk to come out from the wall. I wanted mine not to overlap the door so I took off about half of the pallet and used that.

Once you've measured it, size up the measurement with the pallet and the cut up to that mark on all of the pallets slats making sure its straight.