cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mullz
Frequent Visitor

New column based on a text filter of single number but only the number next to a keyword :/

HI all,

 

Not sure if this is possible but I have a raft of projects getting pulled in from project for the web:

 

MFA - Workstream 1 (DPG3-SW021)

ITSM SD system (DPG1-PR012)
AV Work - Workstream 1 (DPG1-PR020)

 

I need to extract what programme this work is in so the number after the DPG can be 1/2/3/4 which corresponds to different programmes.

 

I've tried using Filter but I don't think that's what I need as that's only returning true/false which wont help if I want a column which has Programme 1/2/3/4

 

Any ideas?


Thanks

 

David

1 ACCEPTED SOLUTION
Mullz
Frequent Visitor

This is resolved, just doing more digging in power query and found the 'Extract' function and also the 'Replace values' function to also change 'DPG1' to the actual programme name!

View solution in original post

2 REPLIES 2
Mullz
Frequent Visitor

This is resolved, just doing more digging in power query and found the 'Extract' function and also the 'Replace values' function to also change 'DPG1' to the actual programme name!

Adescrit
Super User
Super User

There are probably a few ways to do this. One could be in Power Query - Split the column by delimiter "DPG" to create a new column containing your project number.

 

Alternatively create a calculated column in your table, and use this new column as a filter. DAX for the calculated column to return the project number:

 

Project Number = 
VAR __Start =  FIND("DPG",'Work'[Projects])
VAR __Number = VALUE( MID( 'Work'[Projects], __Start + 3, 1))
RETURN
    __Number

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors