Forum Discussion
How to make Power BI desktop show data case-sensitive?
I have columnA with data AAA and aaa. They show in Power Query correct with case-sensitive: AAA and aaa under columnA, but load to Power BI desktop, only show AAA under columnA, so my slicer for columnA doesn't works to filter other data through columnA. How to reslove it?
The code in the last part of the article shows how to incorporate it into a query.
let Source = SourceData, ToList = Table.AddColumn(Source, "Chars", each Text.ToList([OriginalText])), LowerCaseChars = {"a" .. "z"}, AddInvisibleChars = Table.AddColumn( ToList, "AddInvisibleChars", each List.Transform( [Chars], each if List.Contains(LowerCaseChars, _) then _ & Character.FromNumber(8203) else _ ) ), RecombineList = Table.AddColumn( AddInvisibleChars, "OutputText", each Text.Combine([AddInvisibleChars]), type text ), RemovedOtherColumns = Table.SelectColumns(RecombineList, {"OutputText"}) in RemovedOtherColumnsBasically, if you copy and pasted everything from 'ToList' to the end you could add that to the end of your query. All you would need to change is 'Source' and '[OriginalText]' in the 'ToList' line to match your previous step and column name with the lower case characters.
I've attached the PBIX file from the blog post if you'd rather use that.
If you need further help, please post the M code for the query you're trying to incorporate this in to.
5 Replies
- KNP
Super User
Follow through this blog post...
https://blog.crossjoin.co.uk/2019/10/06/power-bi-and-case-sensitivity/
I think it will give you exactly what you need.
- bcdobbs
Community Champion
Thanks for that link, I'd not seen that before!
- elliejiang20
Microsoft Employee
columnA is a column from big data table with a lots of values. I can't manually distingush which values are lower case value. How can I do?
- elliejiang20
Microsoft Employee
columnA is with a lots of values from a big table . Can't manually distingush which values are lower case in hard-code value as per artical above, am I right?
- KNP
Super User
The code in the last part of the article shows how to incorporate it into a query.
let Source = SourceData, ToList = Table.AddColumn(Source, "Chars", each Text.ToList([OriginalText])), LowerCaseChars = {"a" .. "z"}, AddInvisibleChars = Table.AddColumn( ToList, "AddInvisibleChars", each List.Transform( [Chars], each if List.Contains(LowerCaseChars, _) then _ & Character.FromNumber(8203) else _ ) ), RecombineList = Table.AddColumn( AddInvisibleChars, "OutputText", each Text.Combine([AddInvisibleChars]), type text ), RemovedOtherColumns = Table.SelectColumns(RecombineList, {"OutputText"}) in RemovedOtherColumnsBasically, if you copy and pasted everything from 'ToList' to the end you could add that to the end of your query. All you would need to change is 'Source' and '[OriginalText]' in the 'ToList' line to match your previous step and column name with the lower case characters.
I've attached the PBIX file from the blog post if you'd rather use that.
If you need further help, please post the M code for the query you're trying to incorporate this in to.