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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
nataliesmiy1357
Helper IV
Helper IV

custom dax - contains

I am wanting to create a custom measure for this data.  I basically want to say, if EventTypeName contains Bronze... print Bronze, if EvenTypeName contains Silver - print Silver, and if EventTypeName contains Gold, print Gold.

 

I am not sure how to do this.  Thanks in advance,

 

nataliesmiy1357_0-1652796017032.png

 

1 ACCEPTED SOLUTION
themistoklis
Community Champion
Community Champion

@nataliesmiy1357 

 

There are 2 ways using DAX:

 

You should create a New Column not Measure

 

New Column =
SWITCH( TRUE(),
SEARCH( "Bronze", Table[EventTypename],,0) <> 0 , "Bronze",
SEARCH( "Silver ", Table[EventTypename],,0) <> 0 , "Silver ",

SEARCH( "Gold ", Table[EventTypename],,0) <> 0 , "Gold",
"Other"
)

 

OR 

 

New Column = =IF (CONTAINS(Table[EventTypename],"Bronze"),"Bronze",IF (CONTAINS(Table[EventTypename],"Silver "),"Silver ",IF (CONTAINS(Table[EventTypename],"Gold"),"Gold")))

View solution in original post

1 REPLY 1
themistoklis
Community Champion
Community Champion

@nataliesmiy1357 

 

There are 2 ways using DAX:

 

You should create a New Column not Measure

 

New Column =
SWITCH( TRUE(),
SEARCH( "Bronze", Table[EventTypename],,0) <> 0 , "Bronze",
SEARCH( "Silver ", Table[EventTypename],,0) <> 0 , "Silver ",

SEARCH( "Gold ", Table[EventTypename],,0) <> 0 , "Gold",
"Other"
)

 

OR 

 

New Column = =IF (CONTAINS(Table[EventTypename],"Bronze"),"Bronze",IF (CONTAINS(Table[EventTypename],"Silver "),"Silver ",IF (CONTAINS(Table[EventTypename],"Gold"),"Gold")))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors