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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
music583
New Member

Calculating Percentage A Given Value of One Column Has Values In Other Columns

I need to get a table that looks like this:

EmployeeDeadline 1Deadline 2Deadline 3
Person 1YesYesYes
Person 2Yes

No

No
Person 1YesNoNo
Person 3YesYesYes
Person 3YesNoYes

 

To look like this (calculating the percentage of the time that each employee meets a given deadline):

EmployeeDeadline 1Deadline 2Deadline 3
Person 1100%50%50%
Person 2100%0%0%
Person 3100%50%100%
1 ACCEPTED SOLUTION

Just wrap the denominator in a FILTER to exclude blank rows: 

Deadline 1 % =
DIVIDE (
    COUNTROWS ( FILTER ( KEEPFILTERS ( Table1 ), Table1[Deadline 1] = "Yes" ) ),
    COUNTROWS ( FILTER ( KEEPFILTERS ( Table1 ), NOT ISBLANK ( Table1[Deadline 1] ) ) )
)

 

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1776306109833.png

 


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

Please try the measures below:

Deadline 1 % =
DIVIDE (
    COUNTROWS ( FILTER ( KEEPFILTERS ( Table1 ), Table1[Deadline 1] = "Yes" ) ),
    COUNTROWS ( Table1 )
)

Deadline 2 % =
DIVIDE (
    COUNTROWS ( FILTER ( KEEPFILTERS ( Table1 ), Table1[Deadline 2] = "Yes" ) ),
    COUNTROWS ( Table1 )
)

Deadline 3 % =
DIVIDE (
    COUNTROWS ( FILTER ( KEEPFILTERS ( Table1 ), Table1[Deadline 3] = "Yes" ) ),
    COUNTROWS ( Table1 )
)

 

Place Employee in the Rows field of a Matrix visual and add all three measures as Values. Format each measure as percentage via Format visual → Values → display units.

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

That worked like a charm. Unfortunately I forgot one factor. Sometimes the employee hasn't submitted a file yet, so the deadline met column is blank. Following your code, that blank row is included.  I know it needs a filter, but I can't quite figure out how (I work way more with Power Query than DAX). Thank you!

Just wrap the denominator in a FILTER to exclude blank rows: 

Deadline 1 % =
DIVIDE (
    COUNTROWS ( FILTER ( KEEPFILTERS ( Table1 ), Table1[Deadline 1] = "Yes" ) ),
    COUNTROWS ( FILTER ( KEEPFILTERS ( Table1 ), NOT ISBLANK ( Table1[Deadline 1] ) ) )
)

 

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
krishnakanth240
Resident Rockstar
Resident Rockstar

Hi @music583 

Deadline 1% =

DIVIDE(CALCULATE(COUNTROWS('Table'),'Table'[Deadline 1] = "Yes"),COUNTROWS('Table'))

Change it to Percentage by selecting the measure from formatting option.

Similarly you can write measures for Deadline 2% and Deadline 3%

Deku
Super User
Super User

Something like below, with a measure per deadline field. For a clean model and more generalized solution you might be better off depivoting the data first, so that you have 3 columns: employee, deadline index, value

 

Deadline1_perc=

Var total = countrows( tbl )

Var metDeadline =

Calculate(

   Countries( tbl ),

   Tbl[deadline 1] = "Yes"

)

Return

metDeadline/total

 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.