Forum Discussion
How to make Power BI desktop show data case-sensitive?
- 4 years ago
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.
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?
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
RemovedOtherColumns
Basically, 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.