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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
rlsmith1994
Helper II
Helper II

Replace one cell with text, not entire column

I just need to replace one cell in power query (not as easy as I thought. Here is the scenario: 

 

Jerry Lucero (no real names) is stepping down as coordinator of the masters music program, but is still going to be coordinator for the other music program. Here he is in the power query view. 

 

When I go to replace values and just click on the one cell, it replaces all the values in the column, not just that one cell.

 

How do I just replace the single cell value in that one row without changing all the other values in the column? I thought about conditional values, but in my real life data file, I have several conditional columns already. I am looking for a simplier way. I could change the source file in Excel, but I have made a lot of changes to the power query.  

 

Thank you. 

 

Data files - PBIX and XLS: https://drive.google.com/drive/folders/1W1QKc7IBq2sJGckSd7xGcyU9bF9GKcG6?usp=sharing 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @rlsmith1994 ,

 

My solution is to add an index and replace the specific cell.

For example, replace only Jerry Lucero in line 20 with ABC.

vstephenmsft_0-1695793885810.png

1.Add an index column.

vstephenmsft_1-1695793984691.png

vstephenmsft_2-1695794222600.png

2.Add a custom column.

vstephenmsft_3-1695794309757.pngvstephenmsft_4-1695794316402.png

 

You can check more details from my attachment.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @rlsmith1994 ,

 

My solution is to add an index and replace the specific cell.

For example, replace only Jerry Lucero in line 20 with ABC.

vstephenmsft_0-1695793885810.png

1.Add an index column.

vstephenmsft_1-1695793984691.png

vstephenmsft_2-1695794222600.png

2.Add a custom column.

vstephenmsft_3-1695794309757.pngvstephenmsft_4-1695794316402.png

 

You can check more details from my attachment.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Sergii24
Super User
Super User

Hi @rlsmith1994, you'll need to create a composite key (i.e. combination of more than one column to identify the particular row in the table) which will help you to identify the exact row you want to change. Now, create a new conditional column "coordinator NEW" and assing a new value when composite key value is equal to what you need, otherwise keep the previous value from existing "coordinator" column. After that you can cancel composite key as well as old "coordinator" column. Good luck 🙂

 

P.S. to create a composite key, all parts of it (i.e. columns) should be of the same type. If it's not a case, use formatting functions to align all of them to the same data type.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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