Forum Discussion
arvindarvind24
Helper II
4 years agoIF esle Statement
IF else Statement
| Question | Score |
| A | Yes |
| B | No |
| C | No |
| D | Yes |
| A1 | No |
| B1 | Yes |
| C1 | No |
| D1 | Yes |
| Output | |
| Question | Score |
| A | No |
| B | Yes |
| C | Yes |
| D | No |
| A1 | No |
| B1 | Yes |
| C1 | No |
| D1 | Yes |
if[Question] = "B" then
Text.Replace([#"Score"],"No","Yes")
else if Text.Replace([#"Score"],"Yes","No")
else [#"Score"]
amitchandak bvanderwatt RayWu tamerj1 SpartaBI
3 Replies
- amitchandak
Super User
arvindarvind24 , a new column in the power query
if Text.Contains([Question], "1") then [#"Score"],
else if [Question] then Text.Replace([#"Score"],"No","Yes")
else Text.Replace([#"Score"],"Yes","No")
- v-chenwuz-msft
Community Support
Hi arvindarvind24 ,
if Text.Contains( [Question], "1")
then [#"Score"]
else
(
if Text.Contains([Score], "No")
then Text.Replace([Score],"No","Yes")
else Text.Replace([Score],"Yes","No")
)Result:
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- arvindarvind24
Helper II