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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.