Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have separate cards displaying the number of employees who started this month (let's say September) (StartDate)
Under that is the number of employees who left this month (let's say September) (OffboardDate)
Under that I need to calculate the net values/count of those two numbers for a particular month (Count of StartDate - Count of OffboardDate)
The problem I'm running into is that I can't simply filter by month of onboarding/offboarding. I need to filter by general month. E.g., show me the net value of all onboard and offboards for September. (Count of StartDate - Count of OffboardDate for September) It seems really simple but not seeing how to get it displayed with just a general month.
Solved! Go to Solution.
Hi,
I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope you can start from here to come up with a solution for your semantic model.
employee count measure: =
VAR _t =
FILTER (
employee,
OR (
employee[offboard_date] >= MIN ( 'calendar'[Date] ),
employee[offboard_date] = BLANK ()
)
&& employee[start_date] <= MAX ( 'calendar'[Date] )
)
RETURN
IF ( MIN ( 'calendar'[Date] ) <= TODAY (), COUNTROWS ( _t ) )
Hi,
I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope you can start from here to come up with a solution for your semantic model.
employee count measure: =
VAR _t =
FILTER (
employee,
OR (
employee[offboard_date] >= MIN ( 'calendar'[Date] ),
employee[offboard_date] = BLANK ()
)
&& employee[start_date] <= MAX ( 'calendar'[Date] )
)
RETURN
IF ( MIN ( 'calendar'[Date] ) <= TODAY (), COUNTROWS ( _t ) )
Hello @kc08h ,
Providing sample data will help..untill that you can try the below approach this should work...
Step1
First, ensure you have month columns in your data model for both StartDate (onboarding) and OffboardDate (offboarding) to filter by month.
StartMonth = FORMAT([StartDate], "MMMM YYYY")
OffboardMonth = FORMAT([OffboardDate], "MMMM YYYY")
Step2
Create a Meaure to calculate the Onboarding and Offboarding based on the selected month that is your filter.
OnboardingCount =
CALCULATE(
COUNTROWS(Table),
FILTER(Table, FORMAT([StartDate], "MMMM YYYY") = SELECTEDVALUE('Calendar'[MonthYear])))
OffboardingCount =
CALCULATE(
COUNTROWS(Table),
FILTER(Table, FORMAT([OffboardDate], "MMMM YYYY") = SELECTEDVALUE('Calendar'[MonthYear])))
Step 3
Create a third measure to calculate the net attrition (onboardings minus offboardings)
NetAttrition = [OnboardingCount] - [OffboardingCount]
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |