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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
maxs3
Frequent Visitor

Data in form of Text & Number, trying to remove just the Text using direct query.

Hello,

 

I have a column called "L_n" and data within the column is repeated in the form of "Item12314".

I need to remove the "Item" and just store "12314" in the column.

This can be done if I directly import, and transform the data, but I cannot seem to figure out how to do this through direct query.

 

Thank you!

 

1 ACCEPTED SOLUTION
maxs3
Frequent Visitor

This has been solved by using the function "New Column" instead of "New Measure"

 

 

View solution in original post

3 REPLIES 3
maxs3
Frequent Visitor

Hello,

 

I have a column called "L_n" and data within the column is repeated in the form of "Item12314".

 

I need to remove the "Item" and just store "12314" in the column.

 

This can be done if I directly import, and transform the data, but I cannot seem to figure out how to do this through direct query.

 

Thank you!

maxs3
Frequent Visitor

This has been solved by using the function "New Column" instead of "New Measure"

 

 

OwenAuger
Super User
Super User

Hi @maxs3 

Are you querying SQL Server?

I did some tests myself with DirectQuery on SQL Server 2008, and I was able to get both of these methods working with DirectQuery:

  • Power Query: Right-click column header > Replace Values > Put Item in 1st box and leave 2nd box blank
    Creates code like:
    = Table.ReplaceValue(PreviousStep,"Item","",Replacer.ReplaceText,{"L_n"})
  • DAX: Create calculated column using the SUBSTITUTE function:
    CalcColumn = SUBSTITUTE ( YourTable[L_n], "Item", "" )

Do either of these work for you?

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors