Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello all,
I have issue with removing certain part of string value in my column.
Example:
Table "Document"
| DocumentNumber | DocumentSourceCategory |
| 61-2300-B-PID-2350-01 | Master Document |
| 61-2300-B-PID-2350-01-07812 | Project Working Copy |
| 61-2300-B-PID-2350-01-07917D | Project Working Copy |
| 61-2300-B-PID-2350-01-07917 | Project Working Copy |
| 61-2300-B-PID-2350-01-14398 | Project Working Copy |
| 61-2300-B-PID-2350-01-00209 | Project Working Copy |
| 61-2300-B-PID-2350-01-07812-21 | Project Working Copy |
| 61-2300-B-PID-2350-01-05209D | Project Working Copy |
| 61-2300-B-PID-2350-01-07812-21D1 | Project Working Copy |
| 61-2300-B-PID-2350-01-05908 | Project Working Copy |
| 61-2300-B-PID-2350-01-07812D | Project Working Copy |
| 61-2300-B-PID-2350-01-05209 | Project Working Copy |
| 61-2300-B-PID-2350-01-03210D | Project Working Copy |
| 61-2300-B-PID-2350-01-07812-21P | Project Working Copy |
| 61-2300-B-PID-2350-01-07812-21D | Project Working Copy |
| 61-2300-B-PID-2350-01-03210 | Project Working Copy |
Desired New Column that will identify us the Master Document Number of this copies:
| DocumentNumber | DocumentSourceCategory | Document cut |
| 61-2300-B-PID-2350-01 | Master Document | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-07812 | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-07917D | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-07917 | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-14398 | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-00209 | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-07812-21 | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-05209D | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-07812-21D1 | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-05908 | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-07812D | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-05209 | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-03210D | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-07812-21P | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-07812-21D | Project Working Copy | 61-2300-B-PID-2350-01 |
| 61-2300-B-PID-2350-01-03210 | Project Working Copy | 61-2300-B-PID-2350-01 |
Thank you!
Hi @Anonymous one possible solution could be to create new column in Power query using M function Text.Start
(I recognize pattern from your picture: first 21 character should retrive):
New column Document cut code is
= Table.AddColumn(#"Promoted Headers", "Document cut", each Text.Start([DocumentNumber],21))
I hope this help
Proud to be a Super User!
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 17 | |
| 16 | |
| 12 | |
| 7 | |
| 5 |