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.
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
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
32 | |
30 | |
18 | |
18 |