Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Measure to extract specific digits from a text

Hi,

 

What measure can I use to extract from the 18th digit of a given text to the 21 (4 Digits)

 

Data

ZGONZALEZ_0-1607562532120.png

This is easy in excel, using probably  =len and or =mid formulas

ZGONZALEZ_1-1607562737800.png

 

Please advice

-Z

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, you want to get a measure that can get the 4 digits text from 18th to 21th, you can try my steps:

  1. Create a measure:
Digit 18 through 21(4 digits) =

var _text=MID(MAX([Serial_Number]),18,4)

return

IF(ISBLANK(_text),"Don't have a value",_text)
  1. Create a table chart and place column and measure like this:

v-robertq-msft_0-1608001223304.png

 

And you can get what you want.

You can download my test pbix file here

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, you want to get a measure that can get the 4 digits text from 18th to 21th, you can try my steps:

  1. Create a measure:
Digit 18 through 21(4 digits) =

var _text=MID(MAX([Serial_Number]),18,4)

return

IF(ISBLANK(_text),"Don't have a value",_text)
  1. Create a table chart and place column and measure like this:

v-robertq-msft_0-1608001223304.png

 

And you can get what you want.

You can download my test pbix file here

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula

=mid(data[serial_number],18,4)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Sorry Ashish, I'm look for a measure because the data set I'm using does not allow me to create columns, but thank you, is there something else similar using "measures" ?

Best regards,

You are welcome.  Try this measure

=if(hasonevalue(Data[text]),mid(max(data[serial_number]),18,4),blank())


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors