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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Xeth
Frequent Visitor

Need help on getting distinct-count of employees based on filter conditions on utilization

I am a newbie to power-bi and in the process of getting a grasp on dax.

Currently, I have a datamodel covering projects, sub-projects, employees, employee-allocation.
Employee-allocation includes plan, actual in days for each employee on a monthly basis.

Relationships: Project 1:N Sub-projects, Sub-projects 1:N Employee-allocation and Employees 1:N Employee-allocation

Preparing a dashboard at sub-project level...
Keeping the filter contexts, need help on getting distinct-count of employees based on filter conditions on utilization (actual / plan).

* No. of employees with plan=0 and actual>0
* No. of employees with actual > plan
and such


1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Xeth , Assume you have two measure actual and plan  new measures you need

M1=

Countx(values(Employee[Employee]), if( (Isblank([Plan]) || [Plan] = 0) &&[Actual] >0, [Employee], blank())  )

 

M2=

Countx(values(Employee[Employee]), if( [Actual] >[Plan], [Employee], blank())  )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Xeth , Assume you have two measure actual and plan  new measures you need

M1=

Countx(values(Employee[Employee]), if( (Isblank([Plan]) || [Plan] = 0) &&[Actual] >0, [Employee], blank())  )

 

M2=

Countx(values(Employee[Employee]), if( [Actual] >[Plan], [Employee], blank())  )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandakThank you.
A simple solution instead of the complex methods I was trying to apply.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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