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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
richard-powerbi
Post Patron
Post Patron

Column name as variable?

= (Source as table, optional Product as text) =>
let
   #"Replaced Value" = Table.ReplaceValue(Source, each Table.Column(Source, Product), each "xx", 
   Replacer.ReplaceText, {Product})
in
   #"Replaced Value"

Results in an error. How to do this?

1 ACCEPTED SOLUTION
richard-powerbi
Post Patron
Post Patron

Nvm, found out that you have to use Record.Field(_, Product) instead of Table.Column(Source, Product)

View solution in original post

1 REPLY 1
richard-powerbi
Post Patron
Post Patron

Nvm, found out that you have to use Record.Field(_, Product) instead of Table.Column(Source, Product)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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 Solution Authors