The observed association between pioglitazone and bladder cancer could be causal or because of bias in the design of prior studies. We hypothesize that proteinuria testing may lead to detection bias if routine test results for proteinuria lead to a full urinalysis. We reanalyzed patients with diabetes mellitus within Kaiser Permanente Northern California. Logistic and Cox regression adjusted for age, sex, race, and smoking were used to assess the association of proteinuria testing with pioglitazone use, subsequent full urinalysis, and diagnosis with bladder cancer. Patients treated with pioglitazone were more likely than others with diabetes to undergo testing for proteinuria (p?0.001). The odds of positive tests for proteinuria were higher among pioglitazone-treated patients (OR?=?1.41, 95%CI 1.36-1.46). A positive proteinuria test was associated with increased odds of completing a urinalysis in the following 6?months (OR?=?1.78, 95%CI 1.73-1.85). Negative and positive proteinuria test results were inversely (hazard ratio (HR) 0.63, 95%CI 0.52-0.75) and positively associated (HR 2.45, 95%CI 2.12-2.82) with bladder cancer risk, respectively. Adjustment for negative and positive proteinuria testing reduced the magnitude of association between pioglitazone and bladder cancer by only 5 to 10% (ever-exposed HR: from 1.06 to 1.01 and >4?years exposure HR: from 1.38 to 1.28). Proteinuria testing may be a confounder in studies of pioglitazone and bladder cancer but does not fully explain the association between pioglitazone and bladder cancer in this cohort. Optimal adjustment for proteinuria testing likely requires knowledge of the test result.