Forum Discussion
compare columns with text values in different queries (DirectQuery mode)
Hi everyone,
I need to do measure for:
if the value in column 1 is contained in column 2 then it displays "YES", if none it displays "NO", Columns are in different queries, and they both are in text format. Report works in directquerry mode.
I try to do it like this.
M = IF(CONTAINSSTRING(SUM(Column2),SUM(Column1)),"YES","NO")
But there is problem with SUM, becouse of STRING.
Can someone help me? thank you.
use MAX or MIN instead of SUM.
You have not mentioned what your data model looks like. Other measure functions may be more appropriate.
Hi Kamill11 ,
Create a measure as below:
Measure = VAR _tab = ALL ( 'Table'[Column1] ) VAR _col1 = SELECTEDVALUE ( 'Table'[Column2] ) RETURN IF ( _col1 IN _tab, "Yes", "No" )And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!
2 Replies
- lbendlin
Super User
use MAX or MIN instead of SUM.
You have not mentioned what your data model looks like. Other measure functions may be more appropriate.
- v-kelly-msft
Community Support
Hi Kamill11 ,
Create a measure as below:
Measure = VAR _tab = ALL ( 'Table'[Column1] ) VAR _col1 = SELECTEDVALUE ( 'Table'[Column2] ) RETURN IF ( _col1 IN _tab, "Yes", "No" )And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!