Forum Discussion
UnearthlyFalcon
Advocate I
6 months agoNew Conditional Column from Two Other Columns in M
Hi all, I have a table like below. ID Pet Type Number Category Unique 1 Cat 1 Unique 2 Dog 2 Unique 3 Cat 3 Unique 4 Dog 3 Unique 5 Cat 2 Unique 6 Dog 1 ...
- 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)
jgeddes
Super User
6 months agoAn 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.
UnearthlyFalcon
Advocate I
6 months agoI needed to change the column type to text for the original two columns, that fixed it!