cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Trying to use a string in a column to come up with a name

Hello, Sorry if I am not the best at explaining, I am fairly new to Power BI, but I will try to do my best. Basically I have a columnn [apppreffer] where about a third of the rows have some sort of variation of med001, med002...and so on. They located in the middle of a string such as DonnaApp_med001_CDL. Each of the med codes have a certain name that corresponds with them. I tried doing something with the containtstring fucntion and then the search function but I couldn't get the formatting correct. Any help is greatly appreciated.

 

Thank you,

Kieran L.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @klehane 

 

This is available in Power BI Desktop.

 

Yes, you could pull out the Med codes in this table and connect it to a table that has the Med codes and their corresponding names.

 

That would be the easiest way.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

15 REPLIES 15
Highlighted
Super User II
Super User II

It looks like you want to extract any text that begins "med" . Is that right?  Do you want a new column?

Post a small data sample (not a picture) please and the desired output.  Someone will help.

Highlighted

Yes I want to use a column, because I tried using a measure but it wouldnt accept the column [apprefer] in the measure.

The column with the data goes something like this (on the left) with the desired output on the right

Group1201_med003_cdl-a-truck-driver-brandingGoogle - PPC -SF
Group1201_med241_Entry-Level-CDL-A-Truck-Driver-Earn-Top-Pay-FAST_StatesboroClickCast - programmatic -SF

Blank

 

AllTruckJobs - General Lead (Experienced) 
1201App_med001_CDL-A-TRUCK-DRIVER-_10_000-IN-LONGEVITY-REWARDS_Atlanta_Campaign-South_LP_Indeed - PPC -SF
Highlighted

Have you tried doing this in Power Query with Add a Column > Column From Examples?

 

Column from examples.png

 Start typing in the med003 text and do so in a few more columns and it will pick up the text between the "_"

 

Does this achieve what you are looking for?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted

Maybe? So i go and add a new column from examples, and in that I put all the different med cods in that column? theres a lot more columns in the table than I showed. There is about 7 million rows of data so would that then automatically go through all of them and trnasform the codes into the company names?

Highlighted

If you type in several of the rows that have _med007_ then it will work out what you want to do and it will extract the med codes into one column automatically.  You will then be able to link the new med code column to the relevant company name.  If I've followed you correctly.  Columns from Examples is really powerful.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted

Is column from examples available on Power BI Desktop? or just the regular version? Would one option be to create a column that pulls out any med codes, then make a table with all the med codes and corresponding names and then connect the two? Would that be easier? Sorry if I don't understand everything.

Highlighted

Hi @klehane 

 

This is available in Power BI Desktop.

 

Yes, you could pull out the Med codes in this table and connect it to a table that has the Med codes and their corresponding names.

 

That would be the easiest way.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Highlighted

Awesome! Would I use the filter function to do that? Or would it be a different one?

Highlighted

How many Med codes/company names do you have?

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors