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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rafterse
Frequent Visitor

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
Frequent Visitor

ledgend. thanks so much 

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors