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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
pbrainard
Helper III
Helper III

NEW COLUMN IF Statement

I want to create a new column for Site on my IR Table. I want to populate the new Site column based on two values in an existing column, or bring the Site name in from a RELATED table. Thought I'd ask first before going down the rabbit hole.

 

Will something like this work?:

 

New Column = IF 'IR Table'[StaffTitle] = "MH Program Manager" THEN "MH", IF 'IR Table'[StaffTitle] = "SA Program Manager" THEN "SA", ELSE 'CASE Table'[Site]

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @pbrainard 


Can you please share some sample of your tables in Text format.
BTW, Try this:

New Column =
VAR _A = 'IR Table'[StaffTitle]
RETURN
    SWITCH (
        _A,
        "MH Program Manager", "MH",
        "SA Program Manager", "SA",
        RELATED ( 'CASE Table'[Site] )
    )



If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 





View solution in original post

2 REPLIES 2
VahidDM
Super User
Super User

Hi @pbrainard 


Can you please share some sample of your tables in Text format.
BTW, Try this:

New Column =
VAR _A = 'IR Table'[StaffTitle]
RETURN
    SWITCH (
        _A,
        "MH Program Manager", "MH",
        "SA Program Manager", "SA",
        RELATED ( 'CASE Table'[Site] )
    )



If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 





Thank you. Perfect. 

Helpful resources

Announcements
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.