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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
aki2lan
Regular Visitor

Find and replace part of word in the first row

Hi Everyone, 

 

In Power Query, is it possible to find and replace or substitute part of a word? 

So for instance in the table below, before I make the first row my header - I would like to transform all the tags from Alpha1/AI.CV (m3/h) to Alpha1/AI (m3/h) etc. (i.e. remove the .CV from all first row). 

 

So in excel you could do, find= ".CV (" and replace with = " ("

(notice that there is a space in front of bracket)

 

Currently:

Time (s)Alpha1/AI.CV (m3/h)Beta2/BI.CV (%)Charlie3/CI.CV (%)
04/06/2020 13:35:001364599
04/06/2020 13:35:011304595
04/06/2020 13:35:0215045105

 

Preferred Outcome: 

Time (s)Alpha1/AI (m3/h)Beta2/BI (%)Charlie3/CI (%)
04/06/2020 13:35:001364599
04/06/2020 13:35:011304595
04/06/2020 13:35:0215045105
1 ACCEPTED SOLUTION

It turns out the first row needed to be transposed (so first row becomes first column), convert the first column with tags to text only and then do a find/replace on first column.

View solution in original post

6 REPLIES 6
AlB
Community Champion
Community Champion

Hi @aki2lan 

You can just select all the column where you want that change, click on the right mouse button, select "Replace values" and there

Value to Find

".CV ("

Replace with -->

" ("

After that you can make the firt row into the column names

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

aki2lan
Regular Visitor

@AlB it did not change the tag - it remained the same. Is the problem that the ".CV" is in between other characters? 

AlB
Community Champion
Community Champion

@aki2lan 

Write the exact values you need found and replaced, without the quote-unquote characters, i.e.

Value to Find

.CV (

Replace with -->

 (

Otherwise it will search for ".CV (" instead of  .CV (

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

aki2lan
Regular Visitor

@AlB Yes I tried it both ways. Once I did the replace, I refreshed preview and it still didn't change the first row

I just tested the find and replace using the entire tag: 

Find: Alpha1/AI.CV (m3/h)

 

Replace with: Alpha1

 

That works! So to me it looks like power query cannot find specific characters inside a word, i.e. ".CV ("

 

Any solution for this? 

It turns out the first row needed to be transposed (so first row becomes first column), convert the first column with tags to text only and then do a find/replace on first column.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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