Reply
RichOB
Helper V
Helper V
Partially syndicated - Outbound

Need help finishing my measure with a Contains section

Hi, using my table below I need a measure that gives me a count of all incident types containing "Aggression". The measure I currently have only selects the singular/exact word and gives me a count of 1 where I need a count of 4. FYI, I need those dates in the measure too.

 

Aggression_24 = (
    CALCULATE(
        Count(Table[Incident_Number]),
        'Table'[Type_of_Incident] = "Aggression",
        'Tables'[Date]>=DATE(2024,1,1),
        'Table'[Date]<=Date(2025,9,1)
    ))

 

DateIncident_Number Type_of_incident
01/01/20241Missing Person
01/02/20242Fall
01/03/20243Theft
01/04/20244Aggression, Threats
01/05/20245Aggression, ASB
01/06/20246Theft
01/07/20247Aggression, ASB, Violence
01/08/20248Medical Concern
01/09/20249Aggression

 

Thanks for your help

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

Syndicated - Outbound

hi @RichOB ,

 

try like:

Aggression_24 = (

    CALCULATE(

        Count(Table[Incident_Number]),

        CONTAINSSTRING('Table'[Type_of_Incident] ,"Aggression"),

        'Tables'[Date]>=DATE(2024,1,1),

        'Table'[Date]<=Date(2025,9,1)

    ))

View solution in original post

2 REPLIES 2
RichOB
Helper V
Helper V

Syndicated - Outbound

Thanks very much @FreemanZ  !

FreemanZ
Super User
Super User

Syndicated - Outbound

hi @RichOB ,

 

try like:

Aggression_24 = (

    CALCULATE(

        Count(Table[Incident_Number]),

        CONTAINSSTRING('Table'[Type_of_Incident] ,"Aggression"),

        'Tables'[Date]>=DATE(2024,1,1),

        'Table'[Date]<=Date(2025,9,1)

    ))

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)