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
cybertor
New Member

delete numbers in a mixed column

Hi, I just wondering how to delete numbers from a mixed txt and numbers in a column.

 

For example, the column is

The Bay

2.45 Royal Crown

0.45 Horse 

Sears Store

 

I would like the output to be

The Bay

Royal Crown

Horse

Sears Store

 

Thanks

 

1 REPLY 1
technolog
Super User
Super User

To remove numbers from a mixed text and numbers column in DAX, you can use a combination of DAX functions. Here's how you can achieve this:

Create a Custom Column:
In Power BI Desktop, go to the Data view, select the table, and then create a new custom column.

Use the DAX Expression:
Use the following DAX expression to remove numbers from the mixed text:

Remove Numbers =
TRIM(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE([ColumnName], "0", ""),
"1", ""),
"2", ""),
"3", ""),
"4", ""),
"5", ""),
"6", ""),
"7", ""),
"8", ""),
"9", "")
)
Replace [ColumnName] with the name of your column.

Result:
After applying the above DAX expression, the new custom column will have the desired output without numbers.

This DAX expression works by substituting each digit (0-9) with an empty string, effectively removing all numbers from the text. The TRIM function is used to remove any extra spaces that might be left after removing the numbers.

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.

Top Solution Authors