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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.