Forum Discussion
SravaniBudde
3 years agoFrequent Visitor
COUNTIF function in power bi
Hi , I am trying to convert excel fromulas inot power bi. Can u please help in convert this. 1.COUNTIFS([@[REJECTED_DATE]],">0") 2.COUNTIFS(Table1[@[ESCAL_TO1]:[ESCAL_TO3_DT]],">0")
PhilipTreacy
Super User
3 years agoHi SravaniBudde
For the 1st one you can use
COUNTIF Rejected Date = CALCULATE(COUNTROWS('DataTable'), FILTER('DataTable', NOT(ISBLANK('DataTable'[Rejected_Date]))))
For the 2nd one use something like this. You'll need to list the columns in your table separately in the formula. My dummy table has 3 columns that need to be checked.
COUNTIFS = CALCULATE(COUNTROWS('DataTable'), FILTER('DataTable', NOT(ISBLANK('DataTable'[Escal_To1])) || NOT(ISBLANK('DataTable'[Escal_To2])) || NOT(ISBLANK('DataTable'[Escal_To3_DT]))))
You can test the date either by using e.g. NOT(ISBLANK('DataTable'[Rejected_Date])) or 'DataTable'[Rejected_Date] > 0
Regards
Phil