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
Moniek
Resolver I
Resolver I

Extra column with data which contains in a other column

Hi 

I have got a table (see screenshot) and I have column Nr and Description and I want to generate the column Result. Is that possible? The results are different based on the positions.

Moniek_0-1705044445675.png

 

1 ACCEPTED SOLUTION
collinsg
Super User
Super User

Good day Moniek,

If the rule is "extract 'P's and digits", this code will extract "Result" from "Description".

= Table.AddColumn(#"Previous Step", "Result", each Text.Select([Description], {"P","0".."9"}), type text)

However, the rule may be stronger than this and may, for example, require digits to be included only if they follow Ps. The finite list of examples aren't enough to deduce it. Nevertheless I hope this helps a bit.

View solution in original post

1 REPLY 1
collinsg
Super User
Super User

Good day Moniek,

If the rule is "extract 'P's and digits", this code will extract "Result" from "Description".

= Table.AddColumn(#"Previous Step", "Result", each Text.Select([Description], {"P","0".."9"}), type text)

However, the rule may be stronger than this and may, for example, require digits to be included only if they follow Ps. The finite list of examples aren't enough to deduce it. Nevertheless I hope this helps a bit.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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