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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Assemble equal data after using the function Table.ReplaceValue

Hello,

 

In my dashboard I wrote a formula in Power Query to replace values according to two conditions like the example below:

if it is an orange in France, then replace the orange by an apple.

 

Leoneedsolution_1-1641478627168.png

 

The formula is :

Table.ReplaceValue(#"Added Custom 1", each [Fruits], each if [Country] = "France" and [Fruits] = "Orange" then "Apple" else [Fruits], Replacer.ReplaceText,{"Fruits"})

 

However when I then create my chart and a drop down list of fruits, "Apple" appears twice instead of once. I checked, "Apple" is spelled the same way and there is no extra space.

 

Do you know how to solve this problem?

 

Thank you very much for your help,

 

Léonie

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

In addition to bcdobbs 's reply, please try Trim function in Power Query.

Here I have a test by add space front or behind "Apple". We can see there are three Apples which look like the same in Filter. 

1.png

I find Clean function couldn't remove them. Try trim, it will work.

1.png

Or find all different "Apples" by filter , copy them and compare them to find the difference.

For reference: Trim Vs Clean in Power BI and Power Query

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

In addition to bcdobbs 's reply, please try Trim function in Power Query.

Here I have a test by add space front or behind "Apple". We can see there are three Apples which look like the same in Filter. 

1.png

I find Clean function couldn't remove them. Try trim, it will work.

1.png

Or find all different "Apples" by filter , copy them and compare them to find the difference.

For reference: Trim Vs Clean in Power BI and Power Query

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bcdobbs
Community Champion
Community Champion

Have you tried using trim as well as clean?

 

Failing that add a new step at end of power query to Replace "Apple" by "Test". Identify any rows that still have something that looks like Apple left which might give a clue.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
amitchandak
Super User
Super User

@Anonymous , There is a clean option in the transform tab in power query, use that on this field and check

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hello @amitchandak, I tried this solution by clicking on "Transform > Clean" but it didn't work. Do you have another idea ? 

@Anonymous ,
Can you a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Unfortunaltly I can't, all data are sensitive

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.