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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
ryan_b_fiting
Post Patron
Post Patron

IF statement with text wildcard

Hey community - 

 

I am looking to create a calculated column or measure based on finding a specific text within an entire text string column.

Below is what I am trying to do (writing out/explaining and not writing the DAX here):

 

PRIORITY GRADING = if NAME CONTAINS "Final Project" AND Days Since Submission >= 3 "High",

                                    if NAME CONTAINS "Final Project" AND Days Since Submission ❤️ "Low",

                                    if NAME DOES NOT CONTAIN "Final Project" AND Days Since Submission >5 "High" otherwise "Low"

 

My issue I am having is with the bolded part above.  How do I search with 'wildcard' to see if the text column contains 'Final Project'.

As always your help is greatly appreciated

Thank You

RyanPriority.PNG

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @ryan_b_fiting ,

 

You may create column like DAX below.

PRIORITY GRADING =
VAR _Find =
    SEARCH ( "Final Project", Table1[Name], 1, -1 )
RETURN
    IF (
        _Find > 0,
        IF ( Table1[Days Since Submission] >= 3, "High", "Low" ),
        IF ( Table1[Days Since Submission] > 5, "High", "Low" )
    )

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi @ryan_b_fiting ,

 

You may create column like DAX below.

PRIORITY GRADING =
VAR _Find =
    SEARCH ( "Final Project", Table1[Name], 1, -1 )
RETURN
    IF (
        _Find > 0,
        IF ( Table1[Days Since Submission] >= 3, "High", "Low" ),
        IF ( Table1[Days Since Submission] > 5, "High", "Low" )
    )

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

amitchandak
Super User
Super User

@ryan_b_fiting ,  You can try Switch True

 

Change as per need

Switch (									
CONTAINSSTRING('Table'[NAME],"Final Project") &&		Table[Days Since Submission] >= 3 "High",
CONTAINSSTRING('Table'[NAME],"Final Project") &&		Table[Days Since Submission] < 3 "High",	
not(CONTAINSSTRING('Table'[NAME],"Final Project"))  &&		Table[Days Since Submission] > 5 "High",
"Low")
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
lbendlin
Super User
Super User

PRIORITY GRADING =
SWITCH (
    TRUE (),
    SEARCH ( NAME, "Final Project"0 ) > 0SWITCH ( 

                     TRUE ()

                     [Days Since Submission] >= 3"High""Low" ),
    [Days Since Submission] > 5"High", "Low"
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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