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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.