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
bvilten
Helper III
Helper III

Use of Table.ReplaceValue

Hello,

I am trying to use the Table.ReplaceValue function and not having much success. I have spent much time looking at and trying various solutions to no avail. Most of the solutions I found were simular to Xiaoxin Sheng's answer in post Solved: Replace value in Power Query based on condition - Microsoft Power BI Community

 

#"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [Category],each if [PO]=1006 and [Category]="D" then "C" else [Category],Replacer.ReplaceText,{"Category"})

 

my version is 

#"ReplacedValue" = Table.ReplaceValue(#"Renamed Columns", each [EVP], each if [department] = "Unassigned" then "No Department" else [EVP], Replacer.ReplaceText,{"EVP"})

 

Which of course produces no errors or changes to the EVP column. I am assuming that my version should value in the [department] column and replace the corresponding [EVP] value with "No Department" and if department does not match "Unassigned" then [EVP] would remain as is. Any ideas why this would fail? I am not very clear on what Replacer.ReplaceText is doing so maybe there is a problem there?

 

I would appreciate your help.

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @bvilten 

 

If your problem is not yet solved, can you provide some sample data for testing? What kind of results do you expect and can you show them with pictures as well?

 

Best Regards

 

vanessafvg
Super User
Super User

can you provide some data?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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