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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
parzival1220
Frequent Visitor

Counting Text Values with Multiple filters

Hi there,

 

Please could I ask for some help with a count? I need to perform a really simple count of text values in a range. E.g. I have a column in a dataset called 'Category', this is a text value. I need to calculate a count of all the items in my dataset that contain one of the values in the list below. However, when I use the DAX below, the code runs but I get an error as seen below when I try to use the measure. I don't understand this error as I'm not trying to compare values, just count where text appears in the string:

 

parzival1220_0-1706018840292.png

DAX

Security Incidents = CALCULATE(COUNT('All EV Incidents'[Category]) IN {

"Audits",
"Qualys",
"Branch Raid",
"Data Loss",
"Denial of Service",
"Internal threat",
"Lost or Stolen device",
"Malware",
"PCI",
"Ransomware",
"Security-Other",
"Third Party Supplier",
"Website Exploit" ,
"Pen Testing",
"SecHQ",
"Threat Intelligence"
}
)
 
Many thanks in advance,
 
Jason
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@parzival1220,

 

Try this measure:

 

Security Incidents =
CALCULATE (
    COUNT ( 'All EV Incidents'[Category] ),
    'All EV Incidents'[Category]
        IN {
            "Audits",
            "Qualys",
            "Branch Raid",
            "Data Loss",
            "Denial of Service",
            "Internal threat",
            "Lost or Stolen device",
            "Malware",
            "PCI",
            "Ransomware",
            "Security-Other",
            "Third Party Supplier",
            "Website Exploit",
            "Pen Testing",
            "SecHQ",
            "Threat Intelligence"
        }
)




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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@parzival1220,

 

Try this measure:

 

Security Incidents =
CALCULATE (
    COUNT ( 'All EV Incidents'[Category] ),
    'All EV Incidents'[Category]
        IN {
            "Audits",
            "Qualys",
            "Branch Raid",
            "Data Loss",
            "Denial of Service",
            "Internal threat",
            "Lost or Stolen device",
            "Malware",
            "PCI",
            "Ransomware",
            "Security-Other",
            "Third Party Supplier",
            "Website Exploit",
            "Pen Testing",
            "SecHQ",
            "Threat Intelligence"
        }
)




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

Proud to be a Super User!




Thanks @DataInsights. I can see what I did wrong, I messed up the syntax in the COUNT section by not including the second 'All EV Incidents'[Category]) line. Thanks again for the help. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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