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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Top Kudoed Authors