cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

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 number Forseeble Injury Count of Injury if Forseeble True 1 TRUE TRUE 2 FALSE FALSE 3 FALSE FALSE 4 FALSE TRUE 5 TRUE FALSE 6 TRUE TRUE 7 FALSE TRUE 8 FALSE FALSE 9 FALSE FALSE
2 ACCEPTED SOLUTIONS
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:

New Member

Hi @FreemanZ , this is perfect!

Thanks a lot !

6 REPLIES 6
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:

New Member

Hi @FreemanZ , this is perfect!

Thanks a lot !

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.

Super User

Hi @ARoma ,

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

New Member

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.

Super User

Hi @ARoma

You can try something like this

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

Announcements

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors