Forum Discussion
karkar
9 years agoHelper III
IN OPERATOR in PowerBi
I want to perform the following in Power Bi.. If Diagnosis_code in('125','126', '127', '128') then category=Proc1 else if Diagnosis_code in('225','226', '227', '228') then category=Proc2 ...
- 9 years ago
Hi karkar,
Thanks for the reply. I need help with the syntax while creating a column in the query editor.
Based on my test, the formula(M) below should work in your scenario. :smileyhappy:
= if List.Contains({125,126,127,128},[Diagnosis_code]) then "Proc1" else if List.Contains({225,226,227,228},[Diagnosis_code]) then "Proc2" else nullRegards
v-ljerr-msft
9 years agoMicrosoft Employee
Hi karkar,
Thanks for the reply. I need help with the syntax while creating a column in the query editor.
Based on my test, the formula(M) below should work in your scenario. :smileyhappy:
= if List.Contains({125,126,127,128},[Diagnosis_code]) then "Proc1"
else if List.Contains({225,226,227,228},[Diagnosis_code]) then "Proc2"
else null
Regards
nirvana_moksh
7 years agoImpactful Individual
v-ljerr-msft - What if this "list" or Column is Alpha-Neumerical column, can we still use the List.Contains function?