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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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