Forum Discussion

Navaneetharaju_'s avatar
3 years ago
Solved

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 Replies

  • 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