It could be related to kidney stones or gall bladder/bile duct issues. You should get it checked out as weight loss for no apparent reason is a bit of a concern -
From Better Medicine -
"Although the color of stool can be affected by different foods and medications, it is typically brownish due to digestion of bile salts, digestive agents made by the liver and stored in the gallbladder.
A reduction or absence of bile salts can cause the stool to become yellow or pale. Bile salt production can be reduced due to severe liver disease such as hepatitis or cirrhosis. The passage of bile salts into the intestines can be prevented by blockages of the bile ducts due to inflammation, gallstones, or external compression. Pain, especially in the right upper abdomen, fever, nausea, itching, and yellowing of the skin and whites of the eyes can also occur with these conditions.
The pancreas also produces substances important for digestion, including the enzyme lipase, which breaks down fats. Excess fat in the stool can cause yellowish, bulky stool that floats, has an oily or greasy appearance, and smells foul. Inflammation of the pancreas can reduce lipase production. Absence of lipase is uncommon, but can result from pancreatic cancer, severe pancreatic disease, cystic fibrosis, or abnormal lipase production that is present from birth (congenital).
Conditions that affect the intestines, especially those that interfere with fat absorption, can also cause yellow stool. For example, Giardia, a parasite that can be found in waste products and contaminated water, can cause yellow diarrhea, fever, and flu-like symptoms.
Yellow stool is unusual, and may be a symptom of a serious medical condition. Seek immediate medical care (call 911) for severe abdominal pain, stool with blood or pus, high fever (higher than 101 degrees Fahrenheit), significant vomiting, seizures, changes in mental status, or sudden behavior changes. Symptoms of dehydration such as decreased urination, increased thirst, fatigue, and light-headedness also require immediate medical care."
You need to see your doctor. It sounds like a gallbladder problem or Celiac disease to me. I'm sure there are other possibilities as well. You need evaluation.