Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |