Nanofiltration has been shown to be effective in removing pharmaceutical compounds from water and wastewater, so different mechanisms can influence treatment performance. In the present work, we carried out a case study evaluating the performance of two nanofiltration membranes in the removal of Atenolol (ATN)—a pharmaceutical compound widely used for the treatment of arterial hypertension—under different conditions such as operating pressure, ATN concentration, and solution pH. By determining the B parameter, which quantifies the solute/membrane affinity, we verified that the solution pH influenced the performance of the membranes, promoting attraction or repulsion between the ATN and the membranes. At pH 2.5, both membranes and ATN were positively charged, causing electrostatic repulsion, showing lower values of the B parameter and, consequently, higher ATN rejections. At such a pH, the mean ATN rejection for the loose membrane (NF270) was 82%, while for the tight membrane (NF90) it was 88%. On the other hand, at 12 bar pressure, the NF70 membrane (5.1 × 10 −5 m s−1) presented mean permeate fluxes about 2.8 times greater than the NF90 membrane (1.8 × 10−5 m s−1), indicating that NF270 is the most suitable membrane for this application.