Forum Discussion
Checking Employee Count on specific date.
- 6 years ago
Hi Jensej ,
Just update your old measure, not write a new measure, add the group field in the below filter, refer to the previous formula in variable:
filter(allexcept(bi_employee,bi_employee(gender),bi_employee(group)),...)Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Jensej , Can you share sample data and sample output in a table format?
check if that can help : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
- Jensej6 years agoHelper V
Hi amitchandak
Not really what i was looking for. I wanted like a Date slicer with only one input field on the report.
And if i put for example 1.1.2020 i want to see how many People was living on that floor at the moment.
It has to calculate like this:
Entry Date <= 1.1.2020
Exit Date > 1.1.2020 or Empty
Now i solved it with two page filters one for Entry Date and one for Exit Date but that could be to complicated for the Enduser that's why i wanted the Field directly in Report
- v-yingjl6 years agoCommunity Support
Hi Jensej ,
Try like this measure and put it in a card visual:
Measure = VAR _date = SELECTEDVALUE ( 'Table'[Date] ) VAR _people = CALCULATE ( SUM ( 'Table'[count] ), FILTER ( ALL ( 'Table' ), 'Table'[Date] <= _date ) ) RETURN IF ( _date = BLANK (), "Please select a date in the slicer", "The number of people as of the selcected date is: " & _people )Attached a sample file that hopes to help you: Checking Employee Count on specific date.pbix
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- Jensej6 years agoHelper V
Hi v-yingjl and amitchandak
Thanks for your replies
So i think im pretty close to a solution now.
I read in another artictle that the easiest way to have only one date to fill in is to only activate the after option in the slicer. Like this i don't have a long list with dates. In my measure i therefor have to change SELECTEDVALUE to MIN.
I have this Measure but i still don't get the correct Value.
I think the problem is at the Var _Employees... I want to say where " Entry_Date is before or same Date as the VAR _Date and the Resign_Date is Empty OR after the VAR _Date.
Is it correct that && = AND and ||= OR in Dax?
Employees at specific Date = Var _Date = MIN(bi_datum[datum]) Var _Employees= CALCULATE(COUNT(bi_Employee[id]), FILTER ( ALL ( bi_Employee), bi_Employee[Entry_Date] <= _Date && (bi_Employee[Resign_Date] = BLANK() || bi_Employee[Resign_Date] > _Date) ) ) RETURN IF ( _Date = BLANK(), "Please choose a Date", "Count of Employees at selected date is: " & _Employees