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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

COUNTROWS While filtering out 2 things

I have a table similar to the one below, however I have many more options. I need all but two of those options counted (Critical and Non-Critical Failures). I feel like there's too many to list on their own to put into the calc, plus if we add more, I want them to come in automatically. I just want to filter out the two. This is my current calc, but it doesn't seem to be working: 

Non Fail Cases = COUNTROWS(FILTER('Cases',NOT('Cases'[Support Type] IN ({"Critical Failure","Non - Critical Failure"}))))
ID numberCategory
123456Critical Failure
123457Critical Failure
123458Scheduling
123459Application
123789Non-Critical Failure
456789Upgrade
1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create an independent "Category" table as slicer:

Slicer = distinct('Cases'[Category])

Then modify the measure as below:

Non Fail Cases = CALCULATE(COUNTROWS('Cases'),FILTER('Cases',NOT('Cases'[Support Type] IN VALUES('Slicer'[Category]))))
The result depends on the selected values in the slicer.
 
Best Regards,
Jay
Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create an independent "Category" table as slicer:

Slicer = distinct('Cases'[Category])

Then modify the measure as below:

Non Fail Cases = CALCULATE(COUNTROWS('Cases'),FILTER('Cases',NOT('Cases'[Support Type] IN VALUES('Slicer'[Category]))))
The result depends on the selected values in the slicer.
 
Best Regards,
Jay
Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
MFelix
Super User
Super User

Hi @Anonymous ,

 

In your measure you select the column support type however in the datamockup you call it Category are they the same or is this an error? Another thing that I notice is that you have spaces on the the measures "Non - Critical Failure" and no spaces on the Mockup "Non-Critical Failure"

 

The measure should work has expected, however the context of the visualization can make it give incorrect numbers, can you provide more context of the error you are getting?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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