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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
talhaparvaiz
Helper I
Helper I

New column with values based on another column

Hi,

 

I have a table that looks something like this

 

Product 

ProdA          

ProdBProdA   

ProdC

ProdDProdB

ProdE   

 

I want to add a new column and set the value to GroupA if any of the row has ProdA in it, otherwise, I want to set it GroupOther.

 

My desired output is something like this

 

Product                   Group

ProdA                      GroupA        

ProdBProdA            GroupA   

ProdC                      GroupOther

ProdE                       GroupOther

 

Please advise how to accomplish it

 

Thanks in advance

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @talhaparvaiz 

 

Try to add a new column like this:

Group =
IF (
    ISERROR ( SEARCH ( "ProdA", yourTable[Product] ) ),
    "GroupOther",
    "GroupA"
)

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @talhaparvaiz ,

You can use the following measure:

Group = var test1=FIND("ProdA",MAX('Table'[Product ]),,0)  return IF(test1=0,"GroupOther","GroupA")

 

 

Then you will see the below:

v-luwang-msft_0-1614153982281.png

 

 

Wish  it is helpful for you!

 

 

Best Regard

Lucien Wang

 

Vera_33
Resident Rockstar
Resident Rockstar

Hi @talhaparvaiz 

 

Try to add a new column like this:

Group =
IF (
    ISERROR ( SEARCH ( "ProdA", yourTable[Product] ) ),
    "GroupOther",
    "GroupA"
)
amitchandak
Super User
Super User

@talhaparvaiz , Create a new column like

 

Switch( True() ,
[Product] in {"ProdA","ProdBProdA"} ,"GroupA",
[Product] in {"ProdC","ProdE"} ,"GroupOther",
,"GroupOther"
)

 

Also check

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors
Top Kudoed Authors