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
bjanzen
Frequent Visitor

Grouping all fields in a table that have a specific word in the string

I have a table that has a column that is string, with in that column I would like to grouop fields that have a word in the string.

 

Example:

 

DeviceName

Jabra 360

Mono Jabra

Built in Speakers

Stereo Jabra

 

I would like to group everthing that has Jabra in it.

 

Tried with FIND Grouped = FIND("jabra","*",Device[DeviceKey],Device[DeviceKey])

but that isnt it, and I am guessing that I cant use COUNT to find words?

 

Any help with this would be greatly appreciated. I am very new to DAX, but so far I am really likeing the power of it.

 

thanks,
Brett

 

 

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @bjanzen,

I reproduce your scenario and get expected result, please follow the steps below.

1. Create a calculated column using the formula below, it returns "Yes" if the column has string "Jabra".

If including the string = IF(ISERROR(SEARCH("Jabra",Table3[DeviceName])),"No","Yes")


1.PNG

2. Create a measure to group fields that have a word in the string, and create a card visual to display it.

count = COUNTROWS(FILTER(Table3,Table3[If including the string]="Yes"))


2.PNG

Best Regards,
Angelia

View solution in original post

2 REPLIES 2
v-huizhn-msft
Employee
Employee

Hi @bjanzen,

I reproduce your scenario and get expected result, please follow the steps below.

1. Create a calculated column using the formula below, it returns "Yes" if the column has string "Jabra".

If including the string = IF(ISERROR(SEARCH("Jabra",Table3[DeviceName])),"No","Yes")


1.PNG

2. Create a measure to group fields that have a word in the string, and create a card visual to display it.

count = COUNTROWS(FILTER(Table3,Table3[If including the string]="Yes"))


2.PNG

Best Regards,
Angelia

Greg_Deckler
Super User
Super User

You could create a new column for it but I would use SEARCH instead of FIND. FIND does not support wildcards and is case sensitive. SEARCH doesn't have those limitations.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.