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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Jase71ds
Advocate I
Advocate I

( COUNTIFS ) Count # of times an employee's name is in table, but only if there are completion dates

 

 

Warning - Utter Newbie and First Post Man Sad

 

Summary - Two tables (one has unique Employee ID values and is where I want the results returned.

I want to do two things, count how many times each employee's name appears in the Employee_Data_Table, and count how many times a date appears. By counting how many times their name appears, I will know how many courses they were assigned. By counting date appearances, I will know how many of their assigned courses they have completed.

 

 PBI_Example.gif

 

Thanks for any help. I am only 1 week into PBI and it's different enough from Excel that I'm struggling.

1 ACCEPTED SOLUTION

Thanks to both of you. I've got it working. As usual, the problem was the guy at the keyboard - otherwise known as "Operator Error".

Again, Thanks - I really appreciate the help and donation of your time.

View solution in original post

4 REPLIES 4
chethan
Resolver III
Resolver III

@Jase71ds

 

Create a DAX Function 

 

Assigned Courses = COUNT(EmpTable[EmpID])
Completed Cours = COUNT(EmpTable[Completed Course])

& find the sample file attached here

chethan - thanks for your time and help!

 

I've gotten your first DAX to work. The second, however, is counting ALL the Completion Dates, but not according to each Employee.

 

Some real examples of what I'm getting:

Paul A. is assigned 22 and has completed 2192

Mike A. is assigned 13 and has completed 2192

Jeremy B. is assigned 6 and has completed 2192

 

The first function rightly takes into account the Employee ID.

The second will need to take into account Employee ID, but only if there is an associated Completion Date. As it currently stands, it is ignoring Employee ID and just counting all the completion dates in the table (2192)

 

Jase.

Hi @Jase71ds,

It's weird, the employee's name and completed data come from the same one of factual table? If it is, please try to create a measure using the formula below, and check if it works fine.

Completed Cours1 = CALCULATE( COUNT(EmpTable[EmpID]),FILTER(EmpTable,EmpTable[Completed Course]<>BLANK()))


Best Regards,
Angelia

Thanks to both of you. I've got it working. As usual, the problem was the guy at the keyboard - otherwise known as "Operator Error".

Again, Thanks - I really appreciate the help and donation of your time.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.