cancel
Showing results for 
Search instead for 
Did you mean: 
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 III
Super User III

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 III
Super User III

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

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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors