Forum Discussion
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
Hi Anonymous ,
Create a measure like thisCount = CALCULATE(COUNT(TableName[ColumnName]),TableName[ColumnName]>0)Replace tablename and columnname accordinglyPlease 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/
2 Replies
- jaideepnema
Solution Sage
Hi Anonymous ,
Create a measure like thisCount = CALCULATE(COUNT(TableName[ColumnName]),TableName[ColumnName]>0)Replace tablename and columnname accordinglyPlease 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/
- Whitewater100
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 " ".)