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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
cferraz_hemav
Helper I
Helper I

Filter by a alphanumeric sequence

Hi all,

 

In a certain table I have duplicated rows where the old ones have this format "name_XXXX-XXX_customer", and the new ones "XXXX-XXX_customer". I want to display in the report only the new ones. Which is the best approach?

 

My colleague who usually gives me support on this is on holidays and I'm trying to get over this before his return hoping the community could help me ;-).

 

Best regards and thanks in advance!

Carlos

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

Perhaps not the most efficient way, but I'm trying to think of ways I can explain to you that don't require custom M code. In the Transform Data Power Query Editor:
Select the Customer column,
Click on the Add Column tab in the ribbon and choose Extract > Text Before Delimiter
Choose _ as your delimter and expand Advanced options.
Start from Right and skip 1 delimiter.
This should give you a new column with the Name portion or blank. Filter this column using the arrow to select only null or blank values.
Close and Apply your changes.
Save.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

6 REPLIES 6
v-xicai
Community Support
Community Support

Hi @cferraz_hemav ,

 

You may enter into Query Editor, select on this column, go to Text Filter-> "Does not Contain", type "name_" beside the option "does not contain".

121.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.

Thanks @v-xicai but name can be any name (e.g. Las Torallas, Seuva-1,...) so I cannot use this approach

lbendlin
Super User
Super User

Do you want to do this in Power Query or in DAX?

I don't have preference on doing it in power query or DAX, which do you think is the best approach?

AllisonKennedy
Super User
Super User

Perhaps not the most efficient way, but I'm trying to think of ways I can explain to you that don't require custom M code. In the Transform Data Power Query Editor:
Select the Customer column,
Click on the Add Column tab in the ribbon and choose Extract > Text Before Delimiter
Choose _ as your delimter and expand Advanced options.
Start from Right and skip 1 delimiter.
This should give you a new column with the Name portion or blank. Filter this column using the arrow to select only null or blank values.
Close and Apply your changes.
Save.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thanks! I'll try and come back 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.