Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mithiladas02
Helper I
Helper I

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 CategorySource
Social MediaLinkdln
JOb Boardsjob street
JOb boardsLinkdln

 

 

How can i show below table in power query?

 

Source CategorySource
Job BoardsJob Boards-Linkdln
Social MediaLinkdln
Job BoardsJob Street
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@mithiladas02 , A new column in power query

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

View solution in original post

Pragati11
Super User
Super User

Hi @mithiladas02 ,

 

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

 

This is the data:

Pragati11_0-1644935557984.png

 

Now under Add Column:

Pragati11_1-1644935649598.png

 Then a new window appears:

Pragati11_3-1644936142812.png

 

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:

Pragati11_4-1644936175430.png

Just remove the Source column:

Pragati11_5-1644936207227.png

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

Pragati11_6-1644936261360.png

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

2 REPLIES 2
Pragati11
Super User
Super User

Hi @mithiladas02 ,

 

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

 

This is the data:

Pragati11_0-1644935557984.png

 

Now under Add Column:

Pragati11_1-1644935649598.png

 Then a new window appears:

Pragati11_3-1644936142812.png

 

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:

Pragati11_4-1644936175430.png

Just remove the Source column:

Pragati11_5-1644936207227.png

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

Pragati11_6-1644936261360.png

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

amitchandak
Super User
Super User

@mithiladas02 , A new column in power query

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.