Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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.
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
Solved! Go to Solution.
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.
I find Clean function couldn't remove them. Try trim, it will work.
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.
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.
I find Clean function couldn't remove them. Try trim, it will work.
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.
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.
Hello @amitchandak, I tried this solution by clicking on "Transform > Clean" but it didn't work. Do you have another idea ?
Unfortunaltly I can't, all data are sensitive