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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors