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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Format Data

Hey guys, 

 

I have the UDER ID data item as 'DB10098989' in my data source. I am using direct query (import mode). How can I format that to get rid of 'DB' in front of it and have just the numeric part of it left?

 

Thanks, 

 

Sona

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , I checked out left/right/len is dax allowed function for column and measure in direct query. I tested it in direct query mode

Column = right([column],LEN([column])-2)

 

Tested in Sql Server direct query

Please refer the supported functions : https://docs.microsoft.com/en-us/analysis-services/tabular-models/dax-formula-compatibility-in-directquery-mode-ssas-2016?view=asallproducts-allversions

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may go to Add column -> Custom column, create custom column like codes below.

 

= Table.AddColumn(Source, “Number”, each Text.Select([UDER ID], {“0”..”9″}))

 

Extract number string.png

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

8 REPLIES 8
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may go to Add column -> Custom column, create custom column like codes below.

 

= Table.AddColumn(Source, “Number”, each Text.Select([UDER ID], {“0”..”9″}))

 

Extract number string.png

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

Anonymous
Not applicable

It worked fine, Amy!

 

Thanks. I accepted it as a solution. 

amitchandak
Super User
Super User

@Anonymous , I checked out left/right/len is dax allowed function for column and measure in direct query. I tested it in direct query mode

Column = right([column],LEN([column])-2)

 

Tested in Sql Server direct query

Please refer the supported functions : https://docs.microsoft.com/en-us/analysis-services/tabular-models/dax-formula-compatibility-in-directquery-mode-ssas-2016?view=asallproducts-allversions

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks a lot. It worked fine.

 

I accepted it as a solution. 

lbendlin
Super User
Super User

Where do you want to do the transformation, in Power Query or in DAX?

Will it always be DB followed by a number? (in that case you could replace DB with an empty string)

Will it always be two characters? in that case you can use substrings etc.

Anonymous
Not applicable

Hey @lbendlin , 

 

Thanks for a quick response. 

 

I want the change in the Power Query.

 

It will always be DB followed by a 8-digit number. 

 

Yes, it will always be two characters. 

 

Thanks, 

Sona

= Table.ReplaceValue(#"previous step","DB","",Replacer.ReplaceText,{"Column Name"})

Anonymous
Not applicable

hey @lbendlin , 

 

The 'Previous Step' part is giving me issues. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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