Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I've searched up and down and not found any pertient results for my issue.
I've created a custom column that extracts three characters out of a text string. I'm think attempting to do a Merge Query using the Custom Column against a column in another table with the same strings. On the Merge PowerBI says the selection has failed to find any matches and if I do hit Ok I just get null values (which makes sense, since it can't find any matches). However, since I can look at the data I know for a fact I have matches.
I should also mention I did recast my custom column as text, as the column in the table I'm attempting to merge in is a Text column.
My data source is an MS-SQL DB.
Thanks for reading!
-Robert
Solved! Go to Solution.
If you convert to real numbers you will lose the leading zeros. I would keep it as text. Use trim, then clean, then transform to lowercase (even for the numbers) then try it again. I actually just ran into this issue and by cleaning the column first, it worked.
Proud to be a Super User!
The query editor is case sensitive. Are you sure the text matches in case as well as characters?
Proud to be a Super User!
@KHorseman - the character strings I'm looking to match are all numerals, so unless I'm missing something, it doesn't seem likely that is the issue...
There might be spaces, blanks or unprintable characters in them. I'd recommend to convert them to "real" number formats and then you should be fine.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
I'll give it a go using PwrBI to convert the columns to numbers. However the data in the Location table was manually entered by me fairly short number of rows and the other data, since its an extraction from a string, I don't see how it could have any misc. characters in it....
Maybe the data in your DB has. With field in "text"-format everything is possible.
Otherwise you can clean and trim both columns instead of converting them to numbers.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
If you convert to real numbers you will lose the leading zeros. I would keep it as text. Use trim, then clean, then transform to lowercase (even for the numbers) then try it again. I actually just ran into this issue and by cleaning the column first, it worked.
Proud to be a Super User!
Thanks!
Clean/Trim/Lowercase helped. I didn't pick through each to determine which one did the trick on which column.
re: leading zeros - exactly why I did it as text, however for the purposes of merging and diagrams it would be a bit inconsequential.
re: the transform and cleaning. I would have to perform that function on the custom column and the column being imported with the Location table, correct?
You are correct. Always duplicate the clean, trim, and transform on any columns you are trying to match. I went from matching 1 out of 8257 to all of them by cleaning up the columns.
Proud to be a Super User!