Forum Discussion
Help with PowerBI query - replace field based on text in another column
I have a table that has the following:
Task, Project, Group
I want to replace the Value in Task with the Value from Project for rows that have "admin" in the Group column. C
= Table.ReplaceValue(#"Replaced Value",each [Task],each if Text.Contains([Group],"admin"), then [Project] else [Task],Replacer.ReplaceText,{"Task"})
getting token errors and insights?
If it works for you please accept it as a solution. If not, pls let me know what result you are getting after removing the comma.
4 Replies
- jennrattenSuper User
You were really close. You just have an extra comma. When you remove the comma before the 'then' it works.
This works.
- dtishenkNew Member
thanks!
- jennrattenSuper User
You're welcome!
- jennrattenSuper User
If it works for you please accept it as a solution. If not, pls let me know what result you are getting after removing the comma.