Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

DAX IN Operator not working as expected

Hi there,

 

I'm trying to create a status flag based on union values of source and destination. For some reason IN operator is not working as expected. Not sure where im missing.

 

Download report from 

https://github.com/ArtiAshu/dummy.git

 

Status = 
--gets list of values from column Source & Destination
VAR _COL1 = CALCULATETABLE(VALUES('Table'[Source]),LEN('Table'[Field])>0,'Table'[Source]<>"")
VAR _COL2 = CALCULATETABLE(VALUES('Table'[DESTINATION]),LEN('Table'[Field])>0,'Table'[Destination]<>"")
--unions the list of value of source and destination
VAR _UNION = DISTINCT(UNION(_COL1,_COL2))
VAR _result = IF ('Table'[AllAirports] IN _UNION, "Field Available","No Field")
RETURN _result

 

 

 

 

Thanks

1 Reply

  • you need to remove the filter, write like this