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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
arvindyadav
Post Partisan
Post Partisan

Need to search specific letter and assign that Name

Hi Team,

 

I have rows that have the name as:

arvind_m_vimal

ashish_d_chopra

harsh_t_paleja

 

and I need to assign it as if _m_ appears it reflects as Mobile, if _d_ appears it reflects as  desktop and if _t_ appears then reflects as tablet otherwise hybrid.

 

 

Thanks,

Arvind

1 ACCEPTED SOLUTION
vivran22
Community Champion
Community Champion

@arvindyadav 

Try this:

 

Column =
IF (
    SEARCH ( "_m_", 'Table'[Name], 1, 0 ),
    "Mobile",
    IF (
        SEARCH ( "_d_", 'Table'[Name], 1, 0 ),
        "Desktop",
        IF ( SEARCH ( "_t_", 'Table'[Name], 1, 0 ), "tablet", "hybrid" )
    )
)

 

Regards,
Vivek

If it helps, please mark it as a solution

Kudos would be a cherry on the top 🙂

https://www.vivran.in/

View solution in original post

3 REPLIES 3
vivran22
Community Champion
Community Champion

@arvindyadav 

Try this:

 

Column =
IF (
    SEARCH ( "_m_", 'Table'[Name], 1, 0 ),
    "Mobile",
    IF (
        SEARCH ( "_d_", 'Table'[Name], 1, 0 ),
        "Desktop",
        IF ( SEARCH ( "_t_", 'Table'[Name], 1, 0 ), "tablet", "hybrid" )
    )
)

 

Regards,
Vivek

If it helps, please mark it as a solution

Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Thanks @vivran22  bro it works.

amitchandak
Super User
Super User

Try Like

Switch(true(),
search("_m",table[Name],1,0)>0 ,"Mobile",
search("_d",table[Name],1,0)>0 ,"Desktop",
"Hybrid"
)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors