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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Find Value from a list within a cell and return said value if found

Hi,

 

I have a list or records that describe issues related to specific devices:

Description
DEVICE 1 Peer Briefly Not Established    
Port Down DEVICE 2  
Network DEVICE 9  Outage    
DEVICE 4 Device Reboot    

 

And I also have a table list of names of all devices in the environment :

Device Name
DEVICE 1
DEVICE 2
DEVICE 3
DEVICE 4
DEVICE 5
DEVICE 6
DEVICE 7
DEVICE 8
DEVICE 9

 

How do I add a column to the first table that will return the name of the DEVICE found in the Description ?

I was able to define this with a small list of devices where I need to specify each device (using

SWITCH(TRUE(),
CONTAINSSTRING(

, but the data I am supposed to apply this to has hundreds of records so I cannot just define each one 

 
5 REPLIES 5
DimaMD
Solution Sage
Solution Sage

hi @Anonymous  DEVICE 1 Does the place have a numerical value?


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
Anonymous
Not applicable

Hi Dima, 

No , not all of them , I just used it in order to easily identify them as examples

@Anonymous too bad, if the devices contained a numerical value then I would have a solution for you.
look at the attached file, maybe it will help you.


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
AlB
Community Champion
Community Champion

Hi @Anonymous 

This is best done in Power Query. Place the following M code in a blank query to see the steps.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnEN83R2VTBUCEhNLVJwKspMTcupVPDLL1FwLS5JTMrJLM5ITTm0AAKVYnWilQLyi0oUXPLL8w4tgGo2UlAAy/illpTnF2UrQIUtFRT8S0sS01NRtEMlTRRcUssyk1MVglKT8vNLlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Description = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Description", type text}}),

    #"Added Custom" = Table.AddColumn(#"Changed Type", "Device", each "Device" & " " & Text.Trim(Text.BeforeDelimiter(Text.AfterDelimiter([Description], "DEVICE "), " ")), type text)
in
    #"Added Custom"

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

amitchandak
Super User
Super User

@Anonymous , I think my video can help

Power BI- Text Part slicer to filter/search text - https://youtu.be/MKKWeOqFG4c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.