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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
brycedwhite
Frequent Visitor

Test.StartsWith any letter

I need help with using Text.Starts with.  I want to test the first character of a string.  If it is any capital letter (A..Z) then return "Letter", if it starts with a "1" then return "It's a 1" else "Not a letter or a 1".  I can't figure out how to test for the first case (A..Z).

Any help would be appreciated!

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use following (replace Column1 appropriately)

if List.Contains({"A".."Z"},Text.Start([Column1],1)) then "Letter" 
else if Text.Start([Column1],1)="1" then "It's a 1" 
else "Not a letter or a 1"

View solution in original post

2 REPLIES 2
brycedwhite
Frequent Visitor

You nailed it!  Thank you very much!!

Vijay_A_Verma
Super User
Super User

Use following (replace Column1 appropriately)

if List.Contains({"A".."Z"},Text.Start([Column1],1)) then "Letter" 
else if Text.Start([Column1],1)="1" then "It's a 1" 
else "Not a letter or a 1"

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 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.

October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors