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
Harish85
Helper II
Helper II

Formula for new column

HI Team,

 

I want to create a new column next to Partner type,

if Partner type is below values then new column(descripton) should show below values, please suggest formula or any other method.

ZZK1LTSD0074K table name, zz_partner_type is the column name.

 

Partner type         Description

RE                           BILL TO 

RG                          PAYER

WE                          SHIP_TO

EL                            END USER LOC

EU                          END_USER

ZK                           DIST

ZR                            RESELLER

3 ACCEPTED SOLUTIONS
Ahmed-Elfeel
Solution Sage
Solution Sage

Hi @Harish85,

 

The easiest way is to use DAX:

  • Go to Data view
  • Select your table ZZK1LTSD0074K
  • Click New Column
  • Paste the formula 
  • Rename the column if needed
Description = 
SWITCH(
    'ZZK1LTSD0074K'[zz_partner_type],
    "RE", "BILL TO",
    "RG", "PAYER", 
    "WE", "SHIP_TO",
    "EL", "END USER LOC",
    "EU", "END_USER",
    "ZK", "DIST",
    "ZR", "RESELLER",
    "Unknown"  -- Default value for any unmatched partner types
)

 

But if your dataset is Large You should use Power query:

  • Go to Power Query Editor
  • Select your table
  • Add Column → Conditional Column
  • Set up the conditions:
Column Name: Description
If [zz_partner_type] = "RE" then "BILL TO"
Else If [zz_partner_type] = "RG" then "PAYER" 
Else If [zz_partner_type] = "WE" then "SHIP_TO"
Else If [zz_partner_type] = "EL" then "END USER LOC"
Else If [zz_partner_type] = "EU" then "END_USER"
Else If [zz_partner_type] = "ZK" then "DIST"
Else If [zz_partner_type] = "ZR" then "RESELLER"
Else "Unknown"
  • Don't forget to Refresh data after using Power query 😅.

 

if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.

View solution in original post

raja1992
Resolver I
Resolver I

I’ve done something similar 🙂. You’ve got two good options:

Option 1: DAX calculated column with SWITCH
Go to Modeling → New column and use:

Description =
SWITCH(
    [zz_partner_type],
    "RE", "BILL TO",
    "RG", "PAYER",
    "WE", "SHIP_TO",
    "EL", "END USER LOC",
    "EU", "END_USER",
    "ZK", "DIST",
    "ZR", "RESELLER",
    BLANK()    // default
)

 

This will create the new Description column right next to your Partner type.

 

Option 2 (cleaner for long-term):
Make a small 2-column table (Partner type ↔ Description) and relate it to your main table. That way, if you ever add more partner types, you only update the mapping table instead of editing the DAX formula.

 

👉 Tip: If you just need a quick fix, go with SWITCH. If you want scalability, build the small mapping table.

View solution in original post

raja1992
Resolver I
Resolver I

I’ve done something similar 🙂. You’ve got two good options:

Option 1: DAX calculated column with SWITCH
Go to Modeling → New column and use:

Description =
SWITCH(
    [zz_partner_type],
    "RE", "BILL TO",
    "RG", "PAYER",
    "WE", "SHIP_TO",
    "EL", "END USER LOC",
    "EU", "END_USER",
    "ZK", "DIST",
    "ZR", "RESELLER",
    BLANK()    // default
)

 

This will create the new Description column right next to your Partner type.

 

Option 2 (cleaner for long-term):
Make a small 2-column table (Partner type ↔ Description) and relate it to your main table. That way, if you ever add more partner types, you only update the mapping table instead of editing the DAX formula.

 

👉 Tip: If you just need a quick fix, go with SWITCH. If you want scalability, build the small mapping table.

View solution in original post

5 REPLIES 5
raja1992
Resolver I
Resolver I

I’ve done something similar 🙂. You’ve got two good options:

Option 1: DAX calculated column with SWITCH
Go to Modeling → New column and use:

Description =
SWITCH(
    [zz_partner_type],
    "RE", "BILL TO",
    "RG", "PAYER",
    "WE", "SHIP_TO",
    "EL", "END USER LOC",
    "EU", "END_USER",
    "ZK", "DIST",
    "ZR", "RESELLER",
    BLANK()    // default
)

 

This will create the new Description column right next to your Partner type.

 

Option 2 (cleaner for long-term):
Make a small 2-column table (Partner type ↔ Description) and relate it to your main table. That way, if you ever add more partner types, you only update the mapping table instead of editing the DAX formula.

 

👉 Tip: If you just need a quick fix, go with SWITCH. If you want scalability, build the small mapping table.

raja1992
Resolver I
Resolver I

I’ve done something similar 🙂. You’ve got two good options:

Option 1: DAX calculated column with SWITCH
Go to Modeling → New column and use:

Description =
SWITCH(
    [zz_partner_type],
    "RE", "BILL TO",
    "RG", "PAYER",
    "WE", "SHIP_TO",
    "EL", "END USER LOC",
    "EU", "END_USER",
    "ZK", "DIST",
    "ZR", "RESELLER",
    BLANK()    // default
)

 

This will create the new Description column right next to your Partner type.

 

Option 2 (cleaner for long-term):
Make a small 2-column table (Partner type ↔ Description) and relate it to your main table. That way, if you ever add more partner types, you only update the mapping table instead of editing the DAX formula.

 

👉 Tip: If you just need a quick fix, go with SWITCH. If you want scalability, build the small mapping table.

v-sshirivolu
Community Support
Community Support

Hi @Harish85 ,
I would also take a moment to thank @Ahmed-Elfeel 
, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions

 

Hi @Harish85 ,

I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.

 

Ahmed-Elfeel
Solution Sage
Solution Sage

Hi @Harish85,

 

The easiest way is to use DAX:

  • Go to Data view
  • Select your table ZZK1LTSD0074K
  • Click New Column
  • Paste the formula 
  • Rename the column if needed
Description = 
SWITCH(
    'ZZK1LTSD0074K'[zz_partner_type],
    "RE", "BILL TO",
    "RG", "PAYER", 
    "WE", "SHIP_TO",
    "EL", "END USER LOC",
    "EU", "END_USER",
    "ZK", "DIST",
    "ZR", "RESELLER",
    "Unknown"  -- Default value for any unmatched partner types
)

 

But if your dataset is Large You should use Power query:

  • Go to Power Query Editor
  • Select your table
  • Add Column → Conditional Column
  • Set up the conditions:
Column Name: Description
If [zz_partner_type] = "RE" then "BILL TO"
Else If [zz_partner_type] = "RG" then "PAYER" 
Else If [zz_partner_type] = "WE" then "SHIP_TO"
Else If [zz_partner_type] = "EL" then "END USER LOC"
Else If [zz_partner_type] = "EU" then "END_USER"
Else If [zz_partner_type] = "ZK" then "DIST"
Else If [zz_partner_type] = "ZR" then "RESELLER"
Else "Unknown"
  • Don't forget to Refresh data after using Power query 😅.

 

if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.

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.