cancel
Showing results for
Did you mean:
Highlighted
New Member

## Calculate percentage based on values

Hi

New to Power BI today so apologies if this is very basic.

I am trying to calculate the percentage of grades in Maths column that are 5 or above.

I have added a new measure for this but believe there is no countif function?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft

## Re: Calculate percentage based on values

You can create a calculated column

`grade = IF(yourTable[value]>=5,"5 or above","less than 5")`

And then create a measure

`perc above 5 = COUNTROWS(FILTER(yourTable,yourTable[value]>=5))/COUNTROWS(ALL(yourTable))`

See more details in the attached pbix file. If you'd like more specific suggestion on your scenario, please post some sample data and expected output.

3 REPLIES 3
Highlighted
New Member

## Re: Calculate percentage based on values

I would also like to be able to view the records of who has that grade.

Thanks

Highlighted
Microsoft

## Re: Calculate percentage based on values

You can create a calculated column

`grade = IF(yourTable[value]>=5,"5 or above","less than 5")`

And then create a measure

`perc above 5 = COUNTROWS(FILTER(yourTable,yourTable[value]>=5))/COUNTROWS(ALL(yourTable))`

See more details in the attached pbix file. If you'd like more specific suggestion on your scenario, please post some sample data and expected output.

Highlighted
Regular Visitor

## Re: Calculate percentage based on values

Hi, I am struggling with something very similar and hope you may be able to help. I want to present the percentage of calls answered within 20s as a gauge byt cant figure out the measure.

Any guidance would be great.

 Ringtime KPI Hit 1 Yes 4 Yes 2 Yes 4 Yes 4 Yes 1 Yes 1 Yes 2 Yes 6 Yes 1 Yes 1 Yes 1 Yes 7 Yes 28 No 33 No 22 No 46 No 2 Yes 1 Yes 3 Yes

Announcements

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

#### Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021