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
Anonymous
Not applicable

Custom Column that returns value from another column

Column "Team" has two unique values. I want to create a custom column that returns the value that is not present in that row. For example, for rows that contain "TSM", I want another column to return "100 Thieves" for that same row.

mmiculcy_0-1611422763347.png

 

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

@Anonymous 

Sure. Create a new calculated column:

New col =
VAR currentTeam_ = Table1[team]
RETURN
    CALCULATE ( DISTINCT ( Table1[Team] ), Table1[Team] <> currentTeam_ , ALL(Table1))

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

View solution in original post

3 REPLIES 3
AlB
Community Champion
Community Champion

@Anonymous 

Sure. Create a new calculated column:

New col =
VAR currentTeam_ = Table1[team]
RETURN
    CALCULATE ( DISTINCT ( Table1[Team] ), Table1[Team] <> currentTeam_ , ALL(Table1))

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

AlB
Community Champion
Community Champion

Hi @Anonymous 

in the advanced editor, add a couple of steps like this at the end of your query (Assumes you have only two different values in [team] as you say):

values = List.Distinct(#"YourLastStep"[team]),
res = Table.AddColumn(#"YourLastStep", each if [team] = values_{0} then values_{1} else values_{0})
in
    res 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Anonymous
Not applicable

Is there a way to do this in dax?

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.