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

Create grouping based on a keyword

Hi there,

 

Can I create custom groups based on a keyword in a particular field?

 

For example, here are a few entries in my field:

 

- $10 cash drop

- 6/19 interest expense

- 6/20 interest expense

- 8/19 DISC 

- $15 cash drop

- 4/23 DISC

- Discovery

 

I want to group all entries that contain the keyword "DISC" but potentially exclude "Discovery."

 

Thank you,

Alex

2 ACCEPTED SOLUTIONS
vanessafvg
Super User
Super User

maybe something like this could work?

 

@aalfa

 

group=
SWITCH (
    TRUE (),
    AND ( SEARCH ( "Disc", Fieldname ) = 1, SEARCH ( "Discovery", Fieldname ) = 0 ), "Disc",
    "NA"
)





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

v-yulgu-msft
Employee
Employee

Hi @aalfa,

 

You could refer to below formula to create a calculated column:

 

Grouping = IF(FIND("DISC",'Create grouping'[Column1],1,0)>0,"DISC","N/A")

 

As FIND function is case sensitive, it will distinguish "DISC" and "Disc", the record containing "Discovery" will be excluded in result.

 

Regards,
Yuliana Gu 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @aalfa,

 

You could refer to below formula to create a calculated column:

 

Grouping = IF(FIND("DISC",'Create grouping'[Column1],1,0)>0,"DISC","N/A")

 

As FIND function is case sensitive, it will distinguish "DISC" and "Disc", the record containing "Discovery" will be excluded in result.

 

Regards,
Yuliana Gu 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vanessafvg
Super User
Super User

maybe something like this could work?

 

@aalfa

 

group=
SWITCH (
    TRUE (),
    AND ( SEARCH ( "Disc", Fieldname ) = 1, SEARCH ( "Discovery", Fieldname ) = 0 ), "Disc",
    "NA"
)





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.