cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stokercw
New Member

Table visualization and case sensitivity

Why does Power BI Desktop change case?

My data is case-sensitive:

DATABASE_NAME                                                    ARCHIVED_DATE
---------------------------------------------------------------- --------------------
EPCD13D                                                          17-DEC-2017 12:00:00
epcd13d                                                          25-DEC-2017 12:00:00
epcd13p                                                          17-DEC-2017 12:00:00
epcd13p                                                          25-DEC-2017 12:00:00
epcd13sby                                                        17-DEC-2017 12:00:00
epcd13sby                                                        25-DEC-2017 12:00:00
epcd13t                                                          17-DEC-2017 12:00:00
epcd13t                                                          25-DEC-2017 12:00:00

 

When I pull this into a table visualizaion:

 

 

PowerBI.jpg

 

Is this a BUG, FEATURE, or PEBKAC?

1 ACCEPTED SOLUTION

Accepted Solutions
freder1ck Kudo Kingpin
Kudo Kingpin

Re: Table visualization and case sensitivity

Happy New Years Day! 

 

Add custom column, not conditional column.

Conditional Column options are too basic to handle List.Contains or invisible characters.

Then paste into the custom column window:

 

if List.Contains(List.Transform({97..122}, each Character.FromNumber(_)), Text.Start([DATABASE_NAME], 1)) then Character.FromNumber(8236) else ""

 

I'm assuming your column is named [DATABASE_NAME], but if not, then substitute the right name.

Basically...
List.Contains({a..z}, "e" is true.
List.Contains({a..z}, "E" is false.

 

Fred

View solution in original post

8 REPLIES 8
vijay_kolisetty
Frequent Visitor

Re: Table visualization and case sensitivity

Hi

 

I think its treating the first values format with the second value. You can post your query in Power BI idea forum to make a glance to the respective people.

 

Regards,

 

Vijay

freder1ck Kudo Kingpin
Kudo Kingpin

Re: Table visualization and case sensitivity

Power Query is case sensitive, so you could remove duplicates there and add an index as a unique id. In most regions, DAX is case insensitive, so it would be good to have a unique identifier. 

 

Table visualizations have a related problem, in that they cannot show rows with duplicate data. So, if you have a check detail with 2 separate line items of $26.99 for different items with the same description, it will display only one row. You would have to include the order line number as well. The idea to prevent this kind of aggregation is here

 

Fred

Highlighted
stokercw
New Member

Re: Table visualization and case sensitivity

Thanks Fred, that is what I was presuming.

Seems like a pretty serious shortfall imo.

I can add an index to get both rows, but still will not be able to display the apprropriate values as they both show up the same.

Yes, I could add other fields as well but that's not really the point.

freder1ck Kudo Kingpin
Kudo Kingpin

Re: Table visualization and case sensitivity

I see what you mean now! Here are two ways to force the lowercase to appear. One is by appending the index to the name. The second is to append an invisible character to the name if the name is first letter is lowercase. Appending a space at the end won't work. 

forums 20171229.png

 

In Power Query, I add a custom column for invisible space if the first character of the name is lowercase.

if List.Contains(List.Transform({97..122}, each Character.FromNumber(_)), Text.Start([Column1.1], 1)) then Character.FromNumber(8236) else ""

97-122 are the ascii characters for lowercase letters. 8236 is an invisible character. 

I then append the Lowercase Space column to the database name. 

 

An alternate way is to pad the start of the name based on the index value: 

Text.Repeat(" ", [Index]) & [Column1.1]

The table visualization strips out leading spaces, but still sees the values as unique.

 

Fred

 

 

stokercw
New Member

Re: Table visualization and case sensitivity

Thanks again Fred, this looks promising!!

I'm a newbie so the syntax adding this conditional column using the list.contains is confusing me and giving me errors.

 

I'll play around with it more after the Holidays

Thanks and have a great New Year's Day.

Moderator v-yuezhe-msft
Moderator

Re: Table visualization and case sensitivity

@stokercw,

You can get more details about how to use list.contains function in the following PBIX file.

https://1drv.ms/u/s!AhsotbnGu1Nogxd-0wt86E_Wr7PG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
freder1ck Kudo Kingpin
Kudo Kingpin

Re: Table visualization and case sensitivity

Happy New Years Day! 

 

Add custom column, not conditional column.

Conditional Column options are too basic to handle List.Contains or invisible characters.

Then paste into the custom column window:

 

if List.Contains(List.Transform({97..122}, each Character.FromNumber(_)), Text.Start([DATABASE_NAME], 1)) then Character.FromNumber(8236) else ""

 

I'm assuming your column is named [DATABASE_NAME], but if not, then substitute the right name.

Basically...
List.Contains({a..z}, "e" is true.
List.Contains({a..z}, "E" is false.

 

Fred

View solution in original post

stokercw
New Member

Re: Table visualization and case sensitivity

Thanks Fred and everyone.

Appending a space if lower case did the trick!

 

if List.Contains(List.Transform({97..122}, each Character.FromNumber(_)), Text.Start([DATABASE_NAME], 1)) then [DATABASE_NAME]&Character.FromNumber(8236) else [DATABASE_NAME]

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors