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
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
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
Maja
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
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.
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
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
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
Hi Maja,
Thanks for fixing the data.
Please see attached. Is that what you want?
Mynda
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!
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.