Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
obriaincian
Resolver I
Resolver I

Nested IF AND Statements

Hi All,

 

I have what seems to be a very simple formula that doesn't seem to be working.

 

All I want to do is return the workstream DRI Email where the workstream DRI Email = USERPRINCIPLENAME(),

If the USERPRINCIPLENAME() is not in the workstream DRI Email check if it's in the Hiring Manager Email if it is return the Hiring Manager Email else "Not a manager or DRI".

 

The issue I'm having is the formula is returning results for both if conditions, I only want it to retun the Hiring Manager Email if the first IF condition isn't met

 

Please see the formula below:

 

 

Var User_ = USERPRINCIPALNAME()

RETURN
IF(
    SELECTEDVALUE(Data[Workstream DRI Email]) = User_,
    SELECTEDVALUE(Data[Workstream DRI Email]),
    IF(
        SELECTEDVALUE(Data[Hiring Manager Email]) = User_ &&
        SELECTEDVALUE(Data[Workstream DRI Email]) <> User_,
        SELECTEDVALUE(Data[Hiring Manager Email]),
        "Not a manager or DRI"
    )
)

 

5 REPLIES 5
obriaincian
Resolver I
Resolver I

@mlsx4 ,

 

It looks like the issue lies with the use of SELECTEDVALUE and the fact that I use this measure in a filter for a visualisation.

The filter for the visualisation is filter out data where the measure does not return "Not a manager or DRI"

obriaincian
Resolver I
Resolver I

@mlsx4 

 

Yes I had tried it without the && but no luck unfortunately.

@obriaincian 

 

But have you tried if the condition is ever met? I mean, with a silly example:

Var User_ = USERPRINCIPALNAME()

RETURN
IF(
    SELECTEDVALUE(Data[Workstream DRI Email]) = User_,
    1,
    0
)

 

@mlsx4 , yes I have. I just can't figure out why it returns data for both IF statements

mlsx4
Memorable Member
Memorable Member

Hi @obriaincian 

 

Var User_ = USERPRINCIPALNAME()

RETURN
IF(
    SELECTEDVALUE(Data[Workstream DRI Email]) = User_,
    SELECTEDVALUE(Data[Workstream DRI Email]),
    IF(
        SELECTEDVALUE(Data[Hiring Manager Email]) = User_ &&,
        SELECTEDVALUE(Data[Hiring Manager Email]),
        "Not a manager or DRI"
    )
)

 

I think you don't need the && condition. If you are in the "FALSE" part of the condition is because the first line is not met. That is  Workstream DRI Email is not the same as User_

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors