Forum Discussion
Anonymous
5 years agoNot applicable
Contains function not returning the correct value
Hi All,
I have written the below code but it is not giving me expected result. Can anyone suggest me where I'm doing mistke.
Measure 2 = CONTAINS(YOY_Cumulative,'YOY_Cumulative'[Name],"2015")
In the above dax 'YOY_Cumulative' - is my table anme
'YOY_Cumulative'[Name] - is my column name
"2015": is the value I'm checking
The 'YOY_Cumulative'[Name] column contsin value like 2015 Cumulative lab, 2015 cumulative rx, 2016 Cumulative lab,Cumulative rx like this.
So for the column containg 2015 it should return True, but it is returning False.
Thanks,
Anand
Hi Anonymous
Use this measure
Measure 2 = CONTAINSSTRING(MAX('YOY_Cumulative'[Name]), "2015")Regards
Phil
3 Replies
- amitchandakSuper User
Anonymous , try of this can work
containsstring('YOY_Cumulative'[Name],"2015")
- PhilipTreacySuper User
Hi Anonymous
Use this measure
Measure 2 = CONTAINSSTRING(MAX('YOY_Cumulative'[Name]), "2015")Regards
Phil
- AnonymousNot applicable
It works thanks Phil.