Forum Discussion
New Conditional Column from Two Other Columns in M
- 6 months ago
This should solve your issue.
= Table.AddColumn(previousStep, "ConditionalColumn", each if [Number Category] = 3 and [Pet Type] = "Dog" then "Adopted" else [Pet Type], type text)
An earlier conditional step should not matter as long as the conditional column we created references the immediate previous step.
If the "Conditional Column" is loaded into the report, and you can view the correct data in the table view, I cannot explain why you are getting the result you are.
I will share my pbix file to see if you can compare between and find the issue.
I can't see the correct data in the table view either, neither in a visual or the power querry. My data is very large though and power querry can't load enough of it to preview what I need to see. I tried to filter by "3" in the category column but it doesn't even think a 3 (or a 2 for that matter) exiss because of the data quantity.
Regardless, I appreciate your help! My code is exactly what you provided. I'll try to keep playing around with different things to see if I can get it to work. I'll go ahead aand mark your answer as the solution, because it should be working for this type of situation haha. Thank you!