Forum Discussion
Creating a custom column to tag items from two separate tables
Hi Anonymous,
This Code will cover up all the scenarios:
Contactability = if(AND(SampleData[Mobile] = "NULL",SampleData[Email] = "NULL"),"NO EMAIL AND SMS",
if(and(SampleData[Email] = "NULL",SampleData[Mobile] <> "NULL"),"SMS Only","EMAIL Only"))The above code will cover the Scenario :
- If There is value in Email Column only then the Tag will be Email Only
- If there is value in Mobile Column only then the Tab will be Mobile Only
- If there is no value in either column then Tag will be NO EMAIL AND SMS
The DAX that I have mentioned above contails all the Scenarios, try that in your dataset and see if you Get the result. I tried with the dataset and it is giving me the required result.
If I answer your question! Mark my post as a solution!
Thanks,
Jayant
Hi Anonymous! What about if Mobile and Email column contains "NULL" where the tag should be No SMS and EMAIL whereas the Mobile and Email column both contains an item and the tag should be With SMS and EMAIL?
- Anonymous8 years agoNot applicable
Anonymous,
in that case this should work :
Contactability = if(AND(SampleData[Mobile] = "NULL",SampleData[Email] = "NULL"),"NO EMAIL AND SMS", if(AND(SampleData[Email] = "NULL",SampleData[Mobile] <> "NULL"),"SMS Only",if(AND(SampleData[Email] <> "NULL",SampleData[Mobile] = "NULL"),"EMAIL Only","With SMS and EMAIL")))
If I answer your question! Mark my post as a solution!
Thanks,
Jayant
- Anonymous8 years agoNot applicable
Hi Anonymous! it does work but it does not work correctly on all items. Would you know why? I have already treated the data by replacing all the blanks into "NULL" but I still get this.
- Anonymous8 years agoNot applicable
Can you paste your Data here. So that I can use the same and try code again.