Forum Discussion

mithiladas02's avatar
mithiladas02
Helper I
4 years ago
Solved

Replace value

I have table like below when i try to replace value  From Source field- Linkdln, it is changing social media- Linkdln also. How can i change only jobboards-linkdln name?  Source Category Source...
  • amitchandak's avatar
    4 years ago

    mithiladas02 , A new column in power query

    if [Source Category] = "Job Boards" and [Source]="Linkdln" then [Source Category] & "-" & [Source] else [Source Category]

  • Pragati11's avatar
    4 years ago

    Hi mithiladas02 ,

     

    Try something as follows in Power Query editor in Power BI.

     

    This is the data:

     

    Now under Add Column:

     Then a new window appears:

     

    Formula that I have written can be seen below in editor window:

    if 
       ([Source Category] = "JOb boards" 
       and [Source] = "Linkdln") 
       then "Job Boards-Linkdln" 
       else [Source]

    You will get following:

    Just remove the Source column:

    Modify data-type of New Source to text and rename it to Source. You will get required results:

     

    Thanks,

    Pragati