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

Creating a Custom column based on Value from one column

Hi Guys,

 

I am just starting off in Power BI, i have following query.

I want to create custom column based on the values in another coumn of the same table.

For example, if Orignal Column contains value ABC cont or ABC Holding  then it should come to custom column as ABC ans so on for other values in original column who meets the criteria.

 

Original ColumnCustom Group
ele HealthcareEST
HIGHNESSPAH
PAHPAH
ABC ContABC
ABC Holding ABC
EST HoldingEST

 

Regards

1 ACCEPTED SOLUTION
NHarington
Frequent Visitor

Hello, 

 

By creating a custom column in powerBI and pasting the following dax query, you will return what you are looking for. (Note that you will need to add more rows for each of your conditions. 

 

NewColumn =
SWITCH(
    TRUE(),
    SEARCH("ABC", [OriginalColumn], 1, 0) > 0, "ABC",
    SEARCH("EST", [OriginalColumn], 1, 0) > 0, "EST",
    BLANK()  -- Or you can add another condition here if needed by simply repeating the above lines
)

 

 Please mark my answer as the solution if this works for you, feel free to respond if you need more clarification!

 

Have a great day

View solution in original post

4 REPLIES 4
suparnababu8
Super User
Super User

Hi @Anonymous 

 

I think for first two rows, it's not possible in Power BI. If we exclude first two rows, then we can do it by using Power Query Editor.

 

There is option called Column from examples.  If you use that, you'll get the expected out put. 
Step-1

suparnababu8_0-1725451069633.png

Select the  Original Column->Addcolumn in top ribbon bar->Click on column from examples(highlighted in yellow)

Step-2
After clicking on column from examples you able to see below picture

suparnababu8_2-1725451298650.png

If you type first 3 letter, then hit enter button, you'll get automaticall all values as expected. Then click ok on above the first characters column.

 

Step-3

suparnababu8_3-1725451419686.png

The just you'll rename the  first characters column as Custom Group.

 

Thanks!

 

NHarington
Frequent Visitor

Hello, 

 

By creating a custom column in powerBI and pasting the following dax query, you will return what you are looking for. (Note that you will need to add more rows for each of your conditions. 

 

NewColumn =
SWITCH(
    TRUE(),
    SEARCH("ABC", [OriginalColumn], 1, 0) > 0, "ABC",
    SEARCH("EST", [OriginalColumn], 1, 0) > 0, "EST",
    BLANK()  -- Or you can add another condition here if needed by simply repeating the above lines
)

 

 Please mark my answer as the solution if this works for you, feel free to respond if you need more clarification!

 

Have a great day

Shivu-2000
Super User
Super User

Hi @Anonymous 

For last 4 entry according to your table you can use.
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-add-column-from-example

https://www.youtube.com/watch?v=BSmmNgO_EOU

And I didnt understand your requirement for starting 2 entries like whats the relation, Can you explain those.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Happy to help!

Anonymous
Not applicable

Hi thanks for reply

 

Acyually the first coloumn (original coloumn) is company name and second coulmn (custom column) is group name. 

i want build a custom coulumn based on which compnay falls under which group.

 

Thanks

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Top Kudoed Authors