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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hidenseek9
Post Patron
Post Patron

Custom column: if a text contains a certain value, then return A

Hello Power BI community,

 

I have a question regarding a custom column.

In my data set, I have a column with different brand names.

(Nike, Addidas, Reebok, etc.)

 

In the same dataset, I have another column with sports name.

(Soccer, Basketball, Tennis, etc.)

 

I would like to create a custom column that will give me

the brand names, but for just Nike,

if the sports is basketball I would like Power BI to return the value, "Nike Basketball".

 

How can I set up a custom column to get what I want?

 

Many thanks,

 

H

1 ACCEPTED SOLUTION

Hi,

 

It works well.  The formula in the Sport column is

 

=FIRSTNONBLANK(FILTER(VALUES(eligible_sports[Eligible Sports]),SEARCH(eligible_sports[Eligible Sports],Data[Description],1,0)),1)

The formula in the next column is

 

=if([Brand]="Nike",[Brand]&" "&[Sport],BLANK())

Untitled.pngUntitled1.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.