Forum Discussion
UnearthlyFalcon
6 months agoAdvocate I
New 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
6 months agoSuper User
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.
UnearthlyFalcon
6 months agoAdvocate I
I needed to change the column type to text for the original two columns, that fixed it!