Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric certified for FREE! Don't miss your chance! Learn more
Hi,
Hopefully a nice easy one! (but not for me obviously!)
I've got a column called [UOP] with units of purchase in it.
e.g:
Box of 25
Case of 10
Box 100
1
25
2 Bottles
I want to strip of the text and leave only numerical values so I can do some calculations.
I'm using the code below, to add a custom column to remove the text from the string, but if there is no text and only a number to start with already then I get an error.
Any help to return the exsiting numerical value rather than the error would be appreciated.
Text.Remove(
[UOP],
{
Character.FromNumber(32) .. Character.FromNumber(47),
Character.FromNumber(58) .. Character.FromNumber(255)
}
)
Solved! Go to Solution.
@AlienSx thanks for the reply. Sorry but I didn't quite understand what you meant.
I have got a solution though - my UOP column was stored as a combination of Text and numbers ABC/123.
I changed the data type to Text on my original column, and it removes the error.
@AlienSx thanks for the reply. Sorry but I didn't quite understand what you meant.
I have got a solution though - my UOP column was stored as a combination of Text and numbers ABC/123.
I changed the data type to Text on my original column, and it removes the error.
This is an example of my current output
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 12 | |
| 12 | |
| 10 | |
| 6 | |
| 5 |