Forum Discussion

dtishenk's avatar
dtishenk
New Member
4 years ago
Solved

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

  • You were really close.  You just have an extra comma.  When you remove the comma before the 'then' it works.

     

    This works.

     

    • jennratten's avatar
      jennratten
      Super 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.