• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

counting new and departing employees|Power Pivot|Excel Forum|My Online Training Hub

You are here: Home / counting new and departing employees|Power Pivot|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower Pivotcounting new and departing employee…
sp_PrintTopic sp_TopicIcon
counting new and departing employees
Avatar
Maja Slegers
Member
Members
Level 0
Forum Posts: 7
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
1
June 13, 2019 - 11:32 pm
sp_Permalink sp_Print

Hi I m new to dax so struggling a bit.

I have my employe ID to count, I have start date and if they left an end date.

With this I should be abel to count my new employes and who left. How ever the end totals are counting up wierd and I cant get it figured out 🙁

This is the code I used.

VAR MinDate = MIN('Overzicht werknemers'[Datum])
VAR MaxDate = MAX('Overzicht werknemers'[Datum])
VAR Exits = CALCULATE(DISTINCTCOUNT('Overzicht werknemers'[Werkn.ID])
, 'Overzicht werknemers'[Datum uitdienst] >= MinDate
&& 'Overzicht werknemers'[Datum uitdienst] <= MaxDate
&& NOT(ISBLANK('Overzicht werknemers'[Datum uitdienst]))
)
RETURN IF(ISBLANK(Exits),0,Exits)

But the totals for jan; feb; maa gives 16 while jan has 7; feb 1 and maa 0

So please help

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4447
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
June 14, 2019 - 3:05 pm
sp_Permalink sp_Print

Hi Maja,

If you're looking at the measure at the month level of detail in the PivotTable then you don't need the MinDate and MaxDate criteria because the filter context will do that for you.

Exits = CALCULATE(DISTINCTCOUNT('Overzicht werknemers'[Werkn.ID])
,FILTER('Overzicht werknemers', 

NOT(

ISBLANK('Overzicht werknemers'[Datum uitdienst] 
))))

This measure counts the exited employees.

If that doesn't work then we'll need to see your model and the PivotTable you're trying to create.

Mynda

Avatar
Maja Slegers
Member
Members
Level 0
Forum Posts: 7
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
3
June 15, 2019 - 12:30 am
sp_Permalink sp_Print

Hey Mynda,

Thank you so much for taking the time to answer. I ve tried this formula but dont think it totally does what it is suppose to do.

I m not sure how to show you. I ve added 3 printscreens 1 is the oucome now. Then a screen of the formula u gave me and then one of the input i have to base muself on. As you see there is a start date always filled in and an exit date only filled in when left.

Does this help?

Thank you so so much 

Majascreen1.pngImage Enlarger

screen2.pngImage Enlarger
screen3.pngImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage screen1.png (208 KB)
  • sp_PlupImage screen2.png (133 KB)
  • sp_PlupImage screen3.png (203 KB)
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4447
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
June 15, 2019 - 12:46 pm
sp_Permalink sp_Print

Hi Maja,

Thanks for the screenshots, however I can't tell from them what the issue is. Are you able to share a mockup Excel file with some sample data showing your desired results vs the result of the measure?

Mynda

Avatar
Maja Slegers
Member
Members
Level 0
Forum Posts: 7
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
5
June 17, 2019 - 11:09 pm
sp_Permalink sp_Print

Hi Mynda,

 

I ve tried my best to put it together.

The first tab is the data I have 

The second and third the outcome I would like.

The second outcome I get now are the printscreens I ve put in before.

For the birthdays I get all the names each month and a number. I m not sure how to get to this one. 

Avatar
Maja Slegers
Member
Members
Level 0
Forum Posts: 7
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
6
June 17, 2019 - 11:10 pm
sp_Permalink sp_Print sp_EditHistory

oeps already send but wanted to thank you in advance for your time and help so far already it is greatly appreciated!!!

And I do not see my attachment in the previous post either. So added it again.

Maja

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4447
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
7
June 18, 2019 - 11:42 am
sp_Permalink sp_Print

Hi Maja,

Can you please check your data as it's full of duplicates. e.g. ID 100260 is in there 3 times for January. I can't get the PivotTable to recondile to your desired solutions. See file attached.

Please correct it in this file as I've added English translations to help me understand the data and I don't have time to do that again.

Thanks,

Mynda

Avatar
Maja Slegers
Member
Members
Level 0
Forum Posts: 7
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
8
June 18, 2019 - 4:58 pm
sp_Permalink sp_Print

Mynda,

I m sorry very unthoughtfull of me I should have done it in English! I ve added some info. 

The dubbles are normal, I link to a map with monthly input. So each month there is an overview with the info. I forgot to adjust the dates in front which refers to the month the list is made. 

I hope that makes it more clear? Thank you so much for your help already!!

Maja

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4447
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
9
June 18, 2019 - 9:50 pm
sp_Permalink sp_Print

Hi Maja,

Thanks for fixing the data.

Please see attached. Is that what you want?

Mynda

Avatar
Maja Slegers
Member
Members
Level 0
Forum Posts: 7
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
10
June 25, 2019 - 4:00 pm
sp_Permalink sp_Print

Mynda you are an Angel!!

Thank you so much. Now I m going to try and figure out what you did so I learn 🙂 

Have a bless day I m so very greatful thanks!

Avatar
Maja Slegers
Member
Members
Level 0
Forum Posts: 7
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
11
June 25, 2019 - 4:25 pm
sp_Permalink sp_Print sp_EditHistory

I ve applied it to mine and works perfect so far. How ever I do not get the newly started from it or the birthdays. These are the two who I couldn't figure out and unless I do not see it these aren't in the pivottable? 

Also I think that they keep appearing while they only should appear when they left that month, the next month they shouldnt be counted since they left previous month. I m not sure if I m explaining myself good. 

I think I m almost there. I ve put the exit in and on that I need to put another one so it checks with the date so they only count if they left that month. 

=CALCULATE([exits], FILTER(ALL('Table1[Datum uitdienst]),[Datum uitdienst]=MIN([Datum])))

This works but I do not get the right totals for the quarters. 

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Aislinn Mellamphy, Lynnette Altomari, Jessica Stewart, Roy Lutke, Jeff Krueger, Natasha Smith, Monique Roussouw
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Sopi Yuniarti
sandra parker
LAFONSO HERNANDEZ
Hayden Hao
Angela chen
Sean Moore
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Forum Stats:
Groups: 3
Forums: 24
Topics: 6214
Posts: 27243

 

Member Stats:
Guest Posters: 49
Members: 31894
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.