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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Count rows ignoring value in other rows

Hi all,

 

I need to create a measure from a single table "Pols Outcome", that provides me with what I believe is a countif, but I can't quite figure it out by videos. I need a single measure that gives me the total rows in "AP", excluding the values that are 0 in AP, whilst also not counting rows in "Canx/Void" with "Void" as a value. 

 

In Excel this is a simple countifs formula =COUNTIFS('Pols Outcome'!F:F,"<>Void",'Pols Outcome'!M:M,">0"). 

 

image.png

 

If anyone could help me here it'd be greatly appreciated!

 

Kind reagrds,

 

Jordan

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=CALCULATE(COUNTROWS('Pols Outcome'),'Pols Outcome'[Canx/Void]<>"Void"&&'Pols Outcome'[AP]>0)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=CALCULATE(COUNTROWS('Pols Outcome'),'Pols Outcome'[Canx/Void]<>"Void"&&'Pols Outcome'[AP]>0)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur  The below worked perfectly! Thank you for the response over the weekend and quick reply this morning!
 
AP Cases = CALCULATE(COUNTROWS('Pols Outcome'),'Pols Outcome'[Canx/Void]<>"Void",'Pols Outcome'[AP]>0)
 
Kind regards,
 
Jordan 
 
 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

No luck unfortunately! 

image.png

Hi,

Replace the && with a ,


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Anonymous , try like. add remove filter as per need. If you want to use OR use ||

countx(filter(table,table[Canx/Void]<>"void" && table[AP] <> 0),table[AP])
OR
calculate(countrows(filter(table,table[Canx/Void]<>"void" && table[AP] <> 0)))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.