As part of research into student understanding of topics related to thermodynamics and statistical mechanics at the upper division, we have identified student difficulties in applying concepts related to the Boltzmann factor and the canonical partition function. With this in mind, we have developed a guided-inquiry worksheet activity (tutorial) designed to help students develop a better understanding of where the Boltzmann factor comes from and why it is useful. The tutorial guides students through the derivation of both the Boltzmann factor and the canonical partition function. Preliminary results suggest that students who participated in the tutorial had a higher success rate on assessment items than students who had only received lecture instruction on the topic. We present results that motivate the need for this tutorial, the outline of the derivation used, and results from implementations of the tutorial.