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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

COUNTIF and SUMIF to calculate performance KPI

Hello guys,

 

I'm trying to build a performance KPI from the source table below.

I update it every week with a bunch of information and the "as of" column is the driver for the "WeekNum" column.

 

As ofItemResponsibleDelivery DateLateWeekNum
10.aug.20AJohn01.aug.20133
10.aug.20ACesar05.aug.20133
10.aug.20BMark10.jan.21033
10.aug.20ECandace05.feb.21033
10.aug.20TByron07.sep.20033
10.aug.20ELaura08.nov.21033
10.aug.20EDaniel15.feb.20133
10.aug.20EDaniel05.jun.20133
10.aug.20EDaniel08.jun.20133
10.aug.20ECandace8.mar.20133
10.aug.20EByron9.apr.21033
10.aug.20EByron10.may.21033
10.aug.20EMark18.may.20133
17.aug.20ELaura07.sep.20034
17.aug.20ECandace08.nov.21034
17.aug.20ELaura15.feb.20134
17.aug.20ECesar05.jun.20134
17.aug.20EMark08.jun.20134
17.aug.20EJohn8.mar.20134
17.aug.20ECesar9.apr.21034
17.aug.20EMark10.may.21034
17.aug.20ECandace10.jan.21034
17.aug.20EMark07.sep.20034
17.aug.20ECesar08.nov.21034

 

To do so, i'm using CALCULATE + COUNTA and CALCULATE + SUM... but it's not working!

My expectation was to get a result table like this (to be added to the report page 😁😞

 

WeekNumTotal itemsLate itemsPerformance
3313746%
John110%
Cesar110%
Mark2150%
Candace2150%
Byron30100%
Laura10100%
Daniel330%
3411464%
John110%
Cesar3167%
Mark3167%
Candace20100%
Byron00n/a
Laura2150%
Daniel00n/a

 

Total items : COUNTIF: number of items by name and week number

Late items : SUMIF: number of late items by name and week number

Performance : 1-(Late items / Total items)

 

Can you pleeeease help me with those DAX formulas? I'm a newbie at it and i'm trying for more than 3 days now 😅

 

Really appreciate your support!!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You should be able to make a matrix visual with your Week column and Responsible column in the rows, with these 3 measures in the Values area (replace Table with your actual table name).

 

Total Items = COUNT(Table[Item])

 

Late Items = CALCULATE([Total Items], Table[Late] = 1)

 

Performance = DIVIDE([Late Items], [Total Items])

 

(format Performance as percentage).

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

You should be able to make a matrix visual with your Week column and Responsible column in the rows, with these 3 measures in the Values area (replace Table with your actual table name).

 

Total Items = COUNT(Table[Item])

 

Late Items = CALCULATE([Total Items], Table[Late] = 1)

 

Performance = DIVIDE([Late Items], [Total Items])

 

(format Performance as percentage).

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hey Pat!

Worked like a charm!! Thanks for your prompt assistance! really appreciated!

 

BR,

Edson

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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