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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
asalazarjr
Frequent Visitor

How to extract string from name and create product group

Hey All,
Need help creating dax formula or calculated column to extract product density. Any help is greatly appreciated!

Need to go from left product column to right density group:

ProductDensity
A123 B1234 8Gbit 8 77/999 AE 1 AB8Gbit
A123 B12 4Gbit 16 7/999 ABCDE 1 AB4Gbit
A123 B1 2Gbit 16 77/999 AB 1 AB2Gbit
A123 B12346 512Gbit 8 77/99 ABCDE 512Gbit
A123 B123 77/999 ABCDE 1TB1TB


Thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@asalazarjr , Power query Text between delimiter, skip 1 from beginning

https://learn.microsoft.com/en-us/powerquery-m/text-betweendelimiters

https://radacad.com/extract-parts-of-a-text-value-in-power-bi-using-a-delimiter-power-query-transfor...

 

https://youtu.be/oGY4RoPKDOE

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
jewel_at
Helper II
Helper II

Hi @asalazarjr 

 

I would recommend extracting the string in Power Query instead, you can use BetweenDelimiters function:

 

= Table.AddColumn(#"Changed Type", "Density", each if Text.Contains([Product], "TB") = true then Text.BetweenDelimiters([Product], " "," ", 3,0) else if Text.Contains([Product], "Gbit") = true then Text.BetweenDelimiters([Product], " "," ",1,0) else "")

 

This is based on the sample data that you have.

 

Hope this helps!

 

Jewel 

amitchandak
Super User
Super User

@asalazarjr , Power query Text between delimiter, skip 1 from beginning

https://learn.microsoft.com/en-us/powerquery-m/text-betweendelimiters

https://radacad.com/extract-parts-of-a-text-value-in-power-bi-using-a-delimiter-power-query-transfor...

 

https://youtu.be/oGY4RoPKDOE

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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