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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
maryam_arif28
New Member

HR dashboard

Dear Expert,

 

I am making  dashboard, where i have to 4 tables employee master, employee card, department and salary register. i have created a date table, 

 

now i have to calcualte 

 

1. Headcount

2. Male employee

3. female employee

this should be working with Date,Year and month filter.

 

I have two dates in my employee master one is[ employment date] and another is termination date

 

Employee IDFirst NameMiddle NameLast NameaddressLine1addressLine2StateCountryPostal CodemobilePhoneEmployment DateTermination Datestatus
E04Sanskrati SharmaDSO  us  1/1/20193/12/2021Active
E-0012SARA Thomas   us  1/1/00011/1/0001Active
E-003Alex John   us  1/1/20191/1/0001Active

 

then i have department table, i want to caclulate headcount, male and female employee when i click on year or month or quater then they should be changing. I do not want to make any connection because if i have to make then i have tow inactive connection kindlly help, I am on my deadline

 

 

Regards,

Arif

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @maryam_arif28 ,

First, could you please provide the logic for calculating head count, female employee and Male employee? Which table does the gender information of the employee exist in? If there are no other special filter conditions, and assuming the employee gender information is in the employee card table, you can create the following three measures to achieve this. Please find the details in the attachment.

HR Dashboard Help - HC numbers

Headcount = 
VAR _seldate =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN 
    CALCULATE (
        DISTINCTCOUNT ( 'employee master'[Employee ID] ),
        FILTER (
            'employee master',
            'employee master'[Employment Date] <= _seldate
                && (ISBLANK('employee master'[Termination Date])||('employee master'[Termination Date] > _seldate))
        )
    )
female employee = CALCULATE([Headcount],FILTER('employee card','employee card'[Gender]="Female"))
Male employee = CALCULATE([Headcount],FILTER('employee card','employee card'[Gender]="Male"))

yingyinr_0-1628848217769.png

If the measures given above do not meet your needs, please provide sample data from the four tables, the calculation logic and the final result you want to obtain. Thank you.

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @maryam_arif28 ,

First, could you please provide the logic for calculating head count, female employee and Male employee? Which table does the gender information of the employee exist in? If there are no other special filter conditions, and assuming the employee gender information is in the employee card table, you can create the following three measures to achieve this. Please find the details in the attachment.

HR Dashboard Help - HC numbers

Headcount = 
VAR _seldate =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN 
    CALCULATE (
        DISTINCTCOUNT ( 'employee master'[Employee ID] ),
        FILTER (
            'employee master',
            'employee master'[Employment Date] <= _seldate
                && (ISBLANK('employee master'[Termination Date])||('employee master'[Termination Date] > _seldate))
        )
    )
female employee = CALCULATE([Headcount],FILTER('employee card','employee card'[Gender]="Female"))
Male employee = CALCULATE([Headcount],FILTER('employee card','employee card'[Gender]="Male"))

yingyinr_0-1628848217769.png

If the measures given above do not meet your needs, please provide sample data from the four tables, the calculation logic and the final result you want to obtain. Thank you.

Best Regards

amitchandak
Super User
Super User

@maryam_arif28 , Please see the blog and attached file can help

 

You can add filter for gender to get male and female employee

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.