cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Make a new colomn based on words of another column

Hi!

 

I need help making a column that "standarizes" names. Example:

 

ManufacturerStandarized manufacturer
Manufacturer AManufacturer A
ManBManufacturer B
ManufacturerAManufacturer A
Man AManufacturer A
Man A.Manufacturer A
Manufacturer BManufacturer B
ManufacturerBManufacturer B

 

Thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

in a query Editor, hit on custom Column and add this code:

 

if Text.Contains([Manufacturer], "A") then "Manufacturer A" else "Manufacturer B"

let me know if this works.

 

My output:

Capture 13.PNG

 Thanks,

Tejaswi

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

In a Query editor,

you can select this column and right click-> Replace values.

or else you can use the IF statements/SWitch statemnts in a calculated column if you have a small data as in your sample data.

 

here the formula with IF

 

Standardized manufacturer = if(Sheet18[Manufacturer]="Man A"|| (Sheet18[Manufacturer])="Manufacturer A" || (Sheet18[Manufacturer])= "ManufacturerA"|| (Sheet18[Manufacturer])= "Man A." ,"Manufacturer A", "Manufacturer B")

My output with the above Calculated Colum:

 

Capture 87.PNG

You can also use the DAX measure like this:

Measure 3 = Maxx(Sheet18,
Var mylist4= {"Man A", "Man A.", "Manufacturer A", "ManufacturerA"} 
return
 
     IF (Sheet18[Manufacturer] in mylist4, "Manufacturer A", "Manufacturer B"
))

 

Thanks,

Tejaswi

 

 

Anonymous
Not applicable

Thanks!

 

Is there anyway to make it like, if it detects the "A" it knows its manufacturer A?

Anonymous
Not applicable

Hi @Anonymous ,

 

in a query Editor, hit on custom Column and add this code:

 

if Text.Contains([Manufacturer], "A") then "Manufacturer A" else "Manufacturer B"

let me know if this works.

 

My output:

Capture 13.PNG

 Thanks,

Tejaswi

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors