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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Whibley92
Helper II
Helper II

Calculate percentage based on department plus filter

I have 2 sets of data with a unique identifier connecting the 2 data sets.

1 = course competion status

2 = department details

 

No.1 doesnt have the department in but that is what we want calculate.

 

I know I can merge the requirements in Transform Data but is there a way to write one formula that does it all.

 

1. Count completed status for each Department

2. Divide by all status in each department

 

So its within departments basically, not overall count of all departments.

1 ACCEPTED SOLUTION

@Whibley92 

is sales 100% correct? the status is not statrted.

 

Measure = countx(FILTER(Table2,Table2[Status]="Completed"),Table2[Status])/COUNTROWS(Table2)+0
 
11.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
Whibley92
Helper II
Helper II

Thanks yes I had but it was wrong....thanks this works great. 

ryan_mayu
Super User
Super User

could you pls proivde the sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Data set 1

NameEmployee NumberDepartment
A1HR
B2Sales
C3HR
D4Marketing

 

Data set 2

NameEmployee NumberCourseStatusCompletion Date
A1Statutory TrainingIn Progress 
B2Statutory TrainingNot Started 
C3Statutory TrainingCompleted01/05/2024
D4Statutory TrainingCompleted12/04/2024

 

Outcome:

DepartmentCompletion %Overall %
HR50%25%
Sales0%0%
Marketing100%25%

 

@Whibley92 

is sales 100% correct? the status is not statrted.

 

Measure = countx(FILTER(Table2,Table2[Status]="Completed"),Table2[Status])/COUNTROWS(Table2)+0
 
11.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks, the 100% was my error.

 

It has just given 26.26% for all which is the overall completion percentage. How do I make it % within a department.

 

The code doesnt reference table 1 which has the department in, how does it connect?

have you built relationship between two tables?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.