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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
carlbh
Helper I
Helper I

look for specific text from entries in another table

I have a table (CaseData) with a column that contains a complex and variable text string, but within this string is potentially a key standard "phrase" from a list of "string" in another table (Strings). 

e.g. text to be searched

[INFORMATIONAL 20230222-OfficeActivity-SharePointFileOperation via previously unseen IPs

 

Case Data
Microsoft 365 Defender has detected a security threat
Review this incident.
[Microsoft 365]
Microsoft 365 Defender has detected a security threat in your environment
View incident details:
Defender ATP Endpoint Device Isolation.
Endpoint has been Isolated from the Network.
Defender ATP Endpoint Device Isolation.
Endpoint has been Isolated from the Network.
Defender ATP Endpoint Device Isolation.
Endpoint has been Isolated from the Network.
High severity alert: Suspicious URL clicked on
Alert notification email.
[Microsoft 365]
Suspicious URL clicked was detected by Microsoft Defender for Endpoint on
High severity alert: Suspicious URL opened in web browser
Alert notification email.
[Microsoft 365]
Suspicious URL opened in web browser was detected by Microso
High severity alert: Suspicious URL opened in web browser
Alert notification email.
[Microsoft 365]
Suspicious URL opened in web browser was detected by Microso
High severity alert: Suspicious URL clicked on
Alert notification email.
[Microsoft 365]
Suspicious URL clicked was detected by Microsoft Defender for Endpoint on
Microsoft 365 Defender has detected a security threat
Review this incident.
[Microsoft 365]
Microsoft 365 Defender has detected a security threat in your environment
View incident details:
LOW (P3)20230407-AzureADIP-Atypical travel-
At 15:54 on 07/04/2023 an alert "AzureADIP - Atypical travel" has been generated with the following i
INFORMATIONAL (P4)20230314-OfficeActivity-SharePointFileOperation via previously unseen IPs-
At 06:14 on 14/0

 

The text string I am looking for would be 

SharepointFileOperation

StringString Group
Defender has detected a security threatSecurity threat
Endpoint Device Isolation. Device Isolated
Suspicious URL clicked onSuspicious URL
Suspicious URL openedSuspicious URL
Atypical travelLocation anomaly
SharePointFileOperationSharepoint

If found I would want to return is the second column in the Strings table, "StringGroup" associated with the text string I was looking for. 

1 ACCEPTED SOLUTION
amustafa
Super User
Super User

Create a measure column in your CaseData table as:

String Group Search =
VAR CurrentText = SELECTEDVALUE(CaseData[Case Data])
VAR Result =
    CALCULATE(
        MAX(SharepointFileOperation[String Group]),  // Using StringGroup column here
        FILTER(
            SharepointFileOperation,
            NOT ISBLANK(SEARCH(SharepointFileOperation[String], CurrentText, 1, BLANK()))
        )
    )
RETURN
    IF(ISBLANK(Result), "Not Found", Result)
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
amustafa
Super User
Super User

Create a measure column in your CaseData table as:

String Group Search =
VAR CurrentText = SELECTEDVALUE(CaseData[Case Data])
VAR Result =
    CALCULATE(
        MAX(SharepointFileOperation[String Group]),  // Using StringGroup column here
        FILTER(
            SharepointFileOperation,
            NOT ISBLANK(SEARCH(SharepointFileOperation[String], CurrentText, 1, BLANK()))
        )
    )
RETURN
    IF(ISBLANK(Result), "Not Found", Result)
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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