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

Dax Column where other column contains strings

Hi Everyone,

 

Need a DAX Column that returns "Block contract" if Tags Column contains "Block Contract", returns "2 : 1" if tags column contains "2 : 1", returns "1 : 1" if tags column contains "1 : 1" and returns "Block Contract" if none of the other conditions are met

 

any help is appreciated

 

🙂

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @cammar 
Please try

Column2 =
SWITCH (
    TRUE (),
    CONTAINSSTRING ( 'Table'[Column], "Block Contract" ), "Block Contract",
    CONTAINSSTRING ( 'Table'[Column], "2 : 1" ), "2 : 1",
    CONTAINSSTRING ( 'Table'[Column], "1 : 1" ), "1 : 1",
    "Block Contract"
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @cammar 
Please try

Column2 =
SWITCH (
    TRUE (),
    CONTAINSSTRING ( 'Table'[Column], "Block Contract" ), "Block Contract",
    CONTAINSSTRING ( 'Table'[Column], "2 : 1" ), "2 : 1",
    CONTAINSSTRING ( 'Table'[Column], "1 : 1" ), "1 : 1",
    "Block Contract"
)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors