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
ARoma
New Member

Measure: Count of X, if Y=true

Hi , I'm looking for a Measure in PBI that will allow me to get the Count of Injury, if Forseeble is True, from below table.

Incident numberForseebleInjuryCount of Injury if Forseeble True
1TRUETRUE 
2FALSEFALSE 
3FALSEFALSE 
4FALSETRUE 
5TRUEFALSE 
6TRUETRUE 
7FALSETRUE 
8FALSEFALSE 
9FALSEFALSE 
2 ACCEPTED SOLUTIONS
FreemanZ
Super User
Super User

Hi @ARoma 

try to create a measure with this:

ForeseeableInjuryCount =
CALCULATE(
    COUNTROWS(TableName),
    TableName[Forseeable]=TRUE,
    TableName[Injury]=TRUE
)
 
i tried and it worked like this:
FreemanZ_0-1670310230795.png

 

View solution in original post

Hi @FreemanZ , this is perfect!

Thanks a lot !

 

View solution in original post

6 REPLIES 6
FreemanZ
Super User
Super User

Hi @ARoma 

try to create a measure with this:

ForeseeableInjuryCount =
CALCULATE(
    COUNTROWS(TableName),
    TableName[Forseeable]=TRUE,
    TableName[Injury]=TRUE
)
 
i tried and it worked like this:
FreemanZ_0-1670310230795.png

 

Hi @FreemanZ , this is perfect!

Thanks a lot !

 

ARoma
New Member

Hi @djurecicK2

thanks for looking into this. I'm looking for the Count of Injury True, (not incidents), where Forseeble is also True.

 

Hi @ARoma ,

 Have you tried that measure? If so, what were the results?

Hi @djurecicK2

thanks for looking into this. I'm looking for the Count of Injury True, (not all incidents), where Forseeble is also True. If I undersend corectly , the measure you mentioned above is caluculationg all incidents where Forseable is True. 

djurecicK2
Super User
Super User

Hi @ARoma

 You can try something like this

Count of Foreseeable= CALCULATE(COUNT(Tablename[incident number]),FILTER(tablename, tablename[ForeseeableInjury]= true()))

Use "true" if that field is text. Please adapt to your field and table names.

 

Please accept as solution if this answers the question- thanks!

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.