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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
We have "dirty" data, where some cells represent zero values as "-" and some as just 0.
Power Query can't convert columns with "-" into Numeric data type and throw errors in Query. Ideally I have to replace cells that contain only "-" and " -" with zero.
I can't turn columns into text values and remove "-" symbol: then I would have negative values turned to positives, "-84.21" to "84.21". Do you have an idea how to overcome this?
Solved! Go to Solution.
Hi @Anonymous
You can use the Text.End function to replace "-" and "-", then even if you convert the column to text format will not affect the negative value.
Steps:
Convert column into text:
Add custom column as:
if Text.End([Value],1)="-"
then 0
else [Value]
The pbix is attaached.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
Hi @Anonymous,
Is your issue solved?
If the issue has been solved, please adopt the solution to help others.
If you still have some question, please don't hesitate to let me known.
😉
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
Hi @Anonymous
You can use the Text.End function to replace "-" and "-", then even if you convert the column to text format will not affect the negative value.
Steps:
Convert column into text:
Add custom column as:
if Text.End([Value],1)="-"
then 0
else [Value]
The pbix is attaached.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
@Anonymous , remove space, and if you are left out only with - , in that case you can create new column and you can check for value = -
if [col] = "-" then null else [col]
change datatype to number
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |