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
Navaneetharaju_
Helper II
Helper II

Containsstring in Measure

Hi @amitchandak ,

I have wrote the Calculated Column using containsstring dax using sampe data that in Excel.

 

Category =
IF ( CONTAINSSTRING( SR[Short description], "API restart"),"API Restart","Other"))
 
This how i wroted in the calculated column, but now i wanna create same in Measure, because i have a existing power bi data set which is having the data. we can't create calculated column over there in Live connection dataset.
 
Kindly advice how to create a same measure in dax
 
2 ACCEPTED SOLUTIONS
PhilipTreacy
Super User
Super User

@Navaneetharaju_ 

 

Try

IF ( CONTAINSSTRING( MAX(SR[Short description]), "API restart"),"API Restart","Other"))

 

or 

IF ( CONTAINSSTRING( SELECTEDVALUE(SR[Short description]), "API restart"),"API Restart","Other"))

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

Hi @PhilipTreacy ,

Thanks, It's working

View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
Super User

@Navaneetharaju_ 

 

Try

IF ( CONTAINSSTRING( MAX(SR[Short description]), "API restart"),"API Restart","Other"))

 

or 

IF ( CONTAINSSTRING( SELECTEDVALUE(SR[Short description]), "API restart"),"API Restart","Other"))

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi @PhilipTreacy ,

Thanks, It's working

Helpful resources

Announcements
December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.