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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
agkolkata
Regular Visitor

Can I use  variable inside Table.ReplaceValue function ?

Can I use  a variable inside Table.ReplaceValue function ?

/#"Replaced Value32" = Table.ReplaceValue(#"Changed Type2","noFullApplicationNameTag",Text.From([meterCategory]),Replacer.ReplaceValue,{"custom_TagsFullApplicationName"})

 

note : i dont want to use if else query and create a new variable in the process

I need to check for a value in a field and replace the value using anothe field value in the same viariable itself.

 

Any idea how to do it ? 

 

 

1 ACCEPTED SOLUTION
KT_Bsmart2gethe
Impactful Individual
Impactful Individual

Hi @agkolkata ,

Please see code below where I added "each" to 2nd and 3rd arguments: 

Table.ReplaceValue(
   #"Changed Type2",
   each "noFullApplicationNameTag",
   each Text.From([meterCategory]),
   Replacer.ReplaceValue,
   {"custom_TagsFullApplicationName"}
)

 

Regards

KT

 

View solution in original post

4 REPLIES 4
agkolkata
Regular Visitor

worked seamlessly 🙂 thanks mate

KT_Bsmart2gethe
Impactful Individual
Impactful Individual

Hi @agkolkata ,

Please see code below where I added "each" to 2nd and 3rd arguments: 

Table.ReplaceValue(
   #"Changed Type2",
   each "noFullApplicationNameTag",
   each Text.From([meterCategory]),
   Replacer.ReplaceValue,
   {"custom_TagsFullApplicationName"}
)

 

Regards

KT

 

Addon question:

Can we use a combination of 2 variables and a fixed text as the replacement value in this ? 

Hi @agkolkata ,

 

Yes, you can, but you in to add a conditional statement.

I have a video explain the Table.ReplaceValue function.

Table.ReplaceValue 

 

Regards

KT

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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