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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SravaniBudde
Frequent 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")

6 REPLIES 6
SravaniBudde
Frequent Visitor

can u tell for the below excel formula COUNTIFS(Table1[@[ESCAL_TO1]:[ESCAL_TO3_DT]],">0") to convert to power bi

if datatypes are different

ESCAL_TO1 is text with values ''adbcds'
and ESCAL_TO3_DT is date with value "10/31/2022"
 
i am getting below error 
SravaniBudde_0-1679587819835.png

 

SravaniBudde
Frequent Visitor

Hi, Second formula actually 

ESCAL_TO1 is text with values ''adbcds'
and ESCAL_TO3_DT is date with value "10/31/2022"
 
how do i convert the COUNTIFS(Table1[@[ESCAL_TO1]:[ESCAL_TO3_DT]],">0") excel formula to power bi in this case.
SravaniBudde
Frequent Visitor

Hi ,

 

Thanks for the reply.

 

But for the first formula mentioned if i use it am getting wrong value for my data set . May i know what could be reason.

Hi @SravaniBudde 

 

I don't know.  I'd need to see your file to see what is going on.  Can you provide it please.

 

regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


It is resolved isntead i created custom column instead measure column. it resolved my issue now. how can i keep blank values count to 0

 

PhilipTreacy
Super User
Super User

Hi @SravaniBudde 

 

Download example PBIX file

 

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

 

countifsdax.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.