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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
rafterse
Helper I
Helper I

Power query create a column syntax - help

rafterse_0-1712804829910.png

I'm getting this error, what am i missing. 
summary 

i want to create a colum that looks at 1 column for text.contains "XXXXX" and the start of another column doesn't start with text "YYYYY_______" then return a result 

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

Table.AddColumn(
    your_table, 
    "LHRR", 
    each 
        if Text.Contains([a], "xxxx") and 
        not Text.StartsWith([b], "yyyy") 
        then "LHRR" 
        else "notLHRR"
)

View solution in original post

3 REPLIES 3
rafterse
Helper I
Helper I

ledgend. thanks so much 

Anonymous
Not applicable

Hi @rafterse  If @AlienSx 's solution helps, you can accept that reply as Solution. Thanks. 

AlienSx
Super User
Super User

Table.AddColumn(
    your_table, 
    "LHRR", 
    each 
        if Text.Contains([a], "xxxx") and 
        not Text.StartsWith([b], "yyyy") 
        then "LHRR" 
        else "notLHRR"
)

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.