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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply

How to Replace in PQ without indicating Columns

Hello Everyone

 

My table has a structure like

 

A1B1C1D1
1Value1OKOK
2OKOKValue3
3tOKValue2OK

 

The thing is that the name columns cames from a Transpose step which will make they have a "dynamic" name.

 

What I need is to replace all cells contain "Value" to "NO". Since no wildcard options and I can't replace with Startwith because I'd need the column name which will change every update I'm stuck how to do.

 

I found this

#"Core Columns" = {"ColumnX"},

#"Dynamic Columns" = List.Difference(Table.ColumnNames(#"MyTable"),#"Core Columns"),

=Table.ReplaceValue(#"MyTable","Value","NO",Replacer.ReplaceValue, #"Dynamic Columns2")

 

Which works for status "Value" but doesn't work for wildcard  "Value'%'" or StartsWith("Column").

 

Any suggestion how to replace values that "StartsWith" a certain text to a specific Value in the whole table without using the column names?

 

Thanks!!

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

NewStep=Table.ReplaceValue(PreviousStepName,"Value","No",(x,y,z)=>if Text.Contains(x,y) then z else x,Table.ColumnNames(PreviousStepName))

View solution in original post

4 REPLIES 4
wdx223_Daniel
Super User
Super User

NewStep=Table.ReplaceValue(PreviousStepName,"Value","No",(x,y,z)=>if Text.Contains(x,y) then z else x,Table.ColumnNames(PreviousStepName))

Yep this can work, I will use my step where I list my columnnames. Thank you

Nathaniel_C
Community Champion
Community Champion

Hi @JOSELUISMTZRMZ1 ,

Please try this.

Replace Value with NO then in all the columns Extract first 2 characters.  

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel

 

Nathaniel_C_0-1653613511311.png

Nathaniel_C_1-1653613586163.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Nice try, but still having column names in formula which won't work on my case after.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors