Question: I need to do the following:

I have some instances that contain a certain tag, I need to loop through those instances and for each instance which contains that certain tag, if that instance has an elastic ip attached, I need to tag that elastic ip with that same tag. My code is the following:

```
import boto3
import json

region_list = ['us-east-1']
session = boto3.Session(profile_name='default')

for region in region_list:
    ec2 = session.resource('ec2',region)
    client = boto3.client('ec2',region)
    # Retrieve instances that contain this specific tag
    instances = ec2.instances.filter(Filters=[{'Name':'tag:MyTargetTag', 'Values':['*']}])

    for instance in instances:
        for tag in instance.tags:
            if tag['Key'] == "MyTargetTag":
                MyTargetTag = tag['Value']
        ## check if this instance has an elasticip
        ## if it has, assign the value of MyTargetTag to it
        response = client.add_tags(
            ResourceArns=[
                #elasticip ip identifier of some sort,
            ],
            Tags=[
                {
                    'Key': 'MyTargetTag',
                    'Value': MyTargetTag
                },
            ]
        )

```

I've read through the docs and videos and what not but honestly I don't understand it quite completely and I'm just doing trial and error without any success.

Answer: 
Whats up? Either of these should work depending on whether or not you have "null" strings or blank() values:

"null"

```
New Column =
SWITCH (
    TRUE (),
    AND ( [PIDISC] = "null", [PI_DISC] = "null" ), "NO DISC ENTERED",
    [PIDISC] = "null", [PI_DISC],
    [PI_DISC] = "null", [PIDISC]
)

```

Tested:

[![enter image description here](https://i.stack.imgur.com/B9w02.png)](https://i.stack.imgur.com/B9w02.png)

BLANK()

```
New Column =
SWITCH (
    TRUE (),
    AND ( ISBLANK([PIDISC]), ISBLANK([PI_DISC]) ) , "NO DISC ENTERED",
    ISBLANK ( [PIDISC] ), [PI_DISC],
    ISBLANK ( [PI_DISC] ), [PIDISC]
)

```

Hope this helps!
If you'd like to do this in DAX, I recommend using the `SWITCH ( TRUE() ...)` method in lieu of nested if statements (which [this article](https://powerpivotpro.com/2015/03/the-diabolical-genius-of-switch-true/) explains beautifully). I believe this should produce the desired result; based upon your screenshot I assumed those nulls were text strings vs. `NULL`. If it is a true `NULL`, PowerBI uses `BLANK()`.

```
= SWITCH (
    TRUE (),
    [PIDISC] <> "null", [PIDISC],
    [PI_DISC] <> "null", [PI_DISC],
    "no disc entered"
)

```

The first condition that evaluates to `TRUE()` will take precedence.