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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
suryakamesh
Regular Visitor

DAX Function for COUNTIF and/or CALCULATE

Hi need help on DAX,

 

I have a data of columns names as ,student name and status(pass/fail).so need to calculate the pass% and fail% for total ppulation of students with the use of dax funftion.Can any one help me to get the dax function.

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this measures

 

Pass % =CALCULATE(COUNTROWS(Data),Data[Status]="Pass")/COUNTROWS(Data)

Fail % =CALCULATE(COUNTROWS(Data),Data[Status]="Fail")/COUNTROWS(Data)

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Try this measures

 

Pass % =CALCULATE(COUNTROWS(Data),Data[Status]="Pass")/COUNTROWS(Data)

Fail % =CALCULATE(COUNTROWS(Data),Data[Status]="Fail")/COUNTROWS(Data)

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

This worked great!  Thank you.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors