cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
danextian
Resident Rockstar
Resident Rockstar

Function to check whether a text is in upper or lower case

Hi,

 

Is there an existing function to check whether a text is in  upper or lower case or do i still need to create a custom function?

Did I answer your question? Mark my post as a solution!
"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa
1 ACCEPTED SOLUTION

No. You can create a custom function using Text.Lower and/or Text.Upper, like:

 

(Text as text) as logical =>
let
    IsTextAllUpperCase = Text.Upper(Text) = Text
in
    IsTextAllUpperCase
Specializing in Power Query Formula Language (M)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

You could compare the string with the result of UPPER() on that string.

 

You must use the EXACT() function for this:

IsUpperCase = IF(EXACT(UPPER(data[string]), data[string]), TRUE(), FALSE())

PBIDesktop_2017-08-01_10-51-04.png

 

 

On a side note, I just noticed a bug with the Enter Data option (if you enter the same value in different casing, it just makes the casing consistent).

I should have been more specific. Is there one for M.
Did I answer your question? Mark my post as a solution!
"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

No. You can create a custom function using Text.Lower and/or Text.Upper, like:

 

(Text as text) as logical =>
let
    IsTextAllUpperCase = Text.Upper(Text) = Text
in
    IsTextAllUpperCase
Specializing in Power Query Formula Language (M)

View solution in original post

Thanks @MarcelBeug and @Anonymous

 

I didn't  think of comparing a letter to it's uppercase version. 

Did I answer your question? Mark my post as a solution!
"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!