Forum Discussion
Creating a custom column to tag items from two separate tables
Hi Anonymous,
You can use the below Formula to create a new Calculated Column :
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"))
If I answer your question! Mark my post as a solution!
Thanks,
Jayant
- Anonymous8 years agoNot applicable
Hi Anonymous! Thank you so much for the response. It is finally working. However, how about for instances where one column has a value and the other one has none, how do I code it?
Using the same table, I would also like to tag those with SMS Only, Email Only and with SMS and Email. For SMS only, if there is a mobile number present and the email is NULL and vice versa for Email Only tag. Hope you can help me on this one. Thank you!
- Anonymous8 years agoNot applicable
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
- Anonymous8 years agoNot applicable
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?