Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a column that lists model numbers. For example:
ABC24
XY34
QWERTY985
ID-25
As you can see, the number isnt always in the same spot, so its not as easy as saying grab the left 2 characters.
In Excel I can create a formula that will extract from the left all the characters until it finds the first number. That doesnt seem to work the same in Power BI. Anyone know how to do this?
Thanks in advance!
Solved! Go to Solution.
@alfordtp In Power BI click on Edit Queries and then click on "Add Column" Tab and click "Custom Column" and then type the query below. The [data] can be replaced with your column name. [<col name>]
=Text.Select([data],{"0".."9"})
or you could find the first occurance of a number using the following code(this is also custom column in power query editor)
=Text.PositionOfAny([data],{"0".."9"})
@alfordtp In Power BI click on Edit Queries and then click on "Add Column" Tab and click "Custom Column" and then type the query below. The [data] can be replaced with your column name. [<col name>]
=Text.Select([data],{"0".."9"})
or you could find the first occurance of a number using the following code(this is also custom column in power query editor)
=Text.PositionOfAny([data],{"0".."9"})
User | Count |
---|---|
75 | |
75 | |
45 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |