Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Find upper case string in multiple columns

I learned how to use this and it works for one column. 

 

Uppercase =
IF(
    EXACT(UPPER('132330'[FirstName]), '132330'[FirstName])
        , "yes", "no")
 
Is it possible to edit it so it searches multiple columns? Would it be better to create a results column for each field (first & last name, address, email address) I am checking for all caps? Table is not very big. 10K+ rows.
 
Also wondering if a record is empty there is something I can add so the uppercase result does not come back as a "yes". See image.
Snag_198817af.png
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

Column:

Uppercase =
IF (
    [FirstName] = BLANK ()
        && [LastName] = BLANK (),
    BLANK (),
    IF (
        EXACT ( UPPER ( '132330'[FirstName] ), '132330'[FirstName] )
            && EXACT ( UPPER ( '132330'[LastName] ), '132330'[LastName] ),
        "yes",
        "no"
    )
)

vzhangti_0-1670311939716.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

13 REPLIES 13
Anonymous
Not applicable

@amitchandak I am using this for a single column. When filtering a slicer to show "yes" results it is returning numbers as all uppercase values. Is there a way to remove them?Snag_bd06a0f.png

v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

Column:

Uppercase =
IF (
    [FirstName] = BLANK ()
        && [LastName] = BLANK (),
    BLANK (),
    IF (
        EXACT ( UPPER ( '132330'[FirstName] ), '132330'[FirstName] )
            && EXACT ( UPPER ( '132330'[LastName] ), '132330'[LastName] ),
        "yes",
        "no"
    )
)

vzhangti_0-1670311939716.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Community Support Team _Charlotte I was looking to get a "yes" result if the value in any of the columns was all upper case even if the other columns in the row weren't. 

Anonymous
Not applicable

@v-zhangti thank you very much for the method to remove the false result when the Prefix field is empty.
That worked!

Anonymous
Not applicable

@v-zhangti thank you very much for replying. That looks great and I can use in other applications, but I am wanting to have the result to return "yes" if any of the values in a row are all upper case. In your example, all rows would return "yes". That way I will be able to find constituents who have any fields all upper.

amitchandak
Super User
Super User

@Anonymous , You have add a condition with add && , OR ||

 

example

 

IF(
EXACT(UPPER('132330'[FirstName]), '132330'[FirstName]) || EXACT(UPPER('132330'[LatsName]), '132330'[LastName])
, "yes", "no")

 

 

with and

 

IF(
EXACT(UPPER('132330'[FirstName]), '132330'[FirstName]) && EXACT(UPPER('132330'[LatsName]), '132330'[LastName])
, "yes", "no")

Anonymous
Not applicable

@amitchandak can this be combined with some of this code below at the beginning to not include empty cells giving a "yes" anwser?

 

Uppercase =
IF (
[FirstName] = BLANK ()
&& [LastName] = BLANK (),
BLANK (),
IF (
EXACT ( UPPER ( '132330'[Prefix] ), '132330'[Prefix] )
&& EXACT ( UPPER ( '132330'[FirstName] ), '132330'[FirstName] ),
"yes",
"no"
)

@Anonymous , Try like

 

Uppercase =
Switch(True(),
[FirstName] = BLANK ()
&& [LastName] = BLANK (),
EXACT ( UPPER ( '132330'[Prefix] ), '132330'[Prefix] )
&& EXACT ( UPPER ( '132330'[FirstName] ), '132330'[FirstName] ),
"yes",
"no"
)

Anonymous
Not applicable

@amitchandak I get this error message:

Function 'SWITCH' does not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

Anonymous
Not applicable

@amitchandak thank you very much for replying. It is an honor to have you help me. I have admired your knowledge and willingness to help others for a long time. That looks great and I can use it in other applications, but I am wanting to have the result to return "yes" if any of the values in a row are all upper case. That way I will be able to find constituents who have any fields that are all upper case.

@Anonymous , As of now, I think you need to have the same condition on all columns using or (||)

 

for and we can even concat and check

 

IF(
EXACT(UPPER('132330'[FirstName] & '132330'[LatsName]) , '132330'[FirstName] & '132330'[LastName])
, "yes", "no")

 

 

Anonymous
Not applicable

@amitchandak I tried this, but get a "no" when the "IQ" last name should give a "yes" result.Snag_1db01045.png

 

Final =
IF (
    [FirstName] = BLANK ()
        && [LastName] = BLANK (),
    BLANK (),
    IF(
EXACT(UPPER('132330'[Prefix] &'132330'[FirstName] &'132330'[LastName] &'132330'[Suffix] &'132330'[PreferredName] &'132330'[HomeAddress1] &'132330'[HomeAddress2] &'132330'[HomeCity] & '132330'[Email]) , '132330'[Prefix] &'132330'[FirstName] &'132330'[LastName] &'132330'[Suffix] &'132330'[PreferredName] &'132330'[HomeAddress1] &'132330'[HomeAddress2] &'132330'[HomeCity] & '132330'[Email])
, "yes", "no"))

Hi, @Anonymous 

 

You can try the following methods.

Uppercase = 
IF (
    [FirstName] = BLANK ()
        && [LastName] = BLANK (),
    BLANK (),
    IF (
        EXACT ( UPPER ( '132330'[FirstName] ), '132330'[FirstName] )
            || EXACT ( UPPER ( '132330'[LastName] ), '132330'[LastName] )
            ||EXACT ( UPPER ( '132330'[Name] ), '132330'[Name]),
        "yes",
        "no"
    )
)

vzhangti_1-1670550854002.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.