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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Countif in PowerBI

Hi all,

 

I see that there is no countif in PowerBI.

Is there an alternative?

In excel I have applied the formula '=COUNTIF(B6:CN6,">0")'

In PowerBI I am not sure on how to do it.

Can I know how to implement that?

 

Any help is appreciated!

 

Thank you!

Megha

1 ACCEPTED SOLUTION
jaideepnema
Solution Sage
Solution Sage

Hi @Anonymous ,
Create a measure like this 

Count = CALCULATE(COUNT(TableName[ColumnName]),TableName[ColumnName]>0)
 
Replace tablename and columnname accordingly
 

Please accept this as a solution if your question has been answered !!

Appreciate a Kudos 😀

Connect with me on LinkedIn: https://www.linkedin.com/in/jaideepnema/

View solution in original post

2 REPLIES 2
Whitewater100
Solution Sage
Solution Sage

Hello:

The COUNTIF in DAX can be done several ways. It depends on how you set up your model and what tables relate to eachother.

 

If you only have a single table it can also be handled with this:

 

Confirmed = COUNTROWS(
Filter(
TableName,
TableName[Column that has the info you are counting] = "What you are counting in that column")
 
If it's a number field than you don't need the "   ".
)
jaideepnema
Solution Sage
Solution Sage

Hi @Anonymous ,
Create a measure like this 

Count = CALCULATE(COUNT(TableName[ColumnName]),TableName[ColumnName]>0)
 
Replace tablename and columnname accordingly
 

Please accept this as a solution if your question has been answered !!

Appreciate a Kudos 😀

Connect with me on LinkedIn: https://www.linkedin.com/in/jaideepnema/

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.