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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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