cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User II
Super User II

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!

Proud to be a Super User!







"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

Accepted Solutions
Highlighted
Community Champion
Community Champion

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

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
Highlighted
Anonymous
Not applicable

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

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).

Highlighted
Super User II
Super User II

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

I should have been more specific. Is there one for M.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa
Highlighted
Community Champion
Community Champion

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

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

Highlighted
Super User II
Super User II

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

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!

Proud to be a Super User!







"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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors