Bilirubin levels can be affected by various types of cancer, particularly those affecting the liver, pancreas, and bile ducts. For example, in liver cancer or metastatic cancer to the liver, the organ's ability to process bilirubin may be impaired, leading to elevated bilirubin levels. Additionally, tumors in the bile ducts can obstruct the flow of bile, causing bilirubin to accumulate in the blood.