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
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
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.