Forum Discussion
Getting duplicate values in Power BI
- 1 year ago
Hi aditya_ghui
Please Check for Hidden Characters:
Even though you've used TRIM, there might be hidden characters or non-printing characters that are not visible.
Ensure that there are no extra spaces or special characters in your PRODUCT_ID values.
You can use LEN function in SQL to check the length of PRODUCT_ID and see if there are any discrepancies:SELECT distinct PRODUCT_ID, LEN(PRODUCT_ID) AS Length
FROM [XXX-XX-XXXX].[PRODUCTS];
If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.
Hi aditya_ghui
Please Check for Hidden Characters:
Even though you've used TRIM, there might be hidden characters or non-printing characters that are not visible.
Ensure that there are no extra spaces or special characters in your PRODUCT_ID values.
You can use LEN function in SQL to check the length of PRODUCT_ID and see if there are any discrepancies:
SELECT distinct PRODUCT_ID, LEN(PRODUCT_ID) AS Length
FROM [XXX-XX-XXXX].[PRODUCTS];
If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.
- aditya_ghui1 year agoNew Member
Hello Ray_Minds,
I executed query and found that it has '\t' as hidden caracter. I removed this caracter using below code and it worked.
REPLACE(PRODUCT_ID, CHAR(9), '')