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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Osaz
Frequent Visitor

Dax for cummulative count of staff headcount

I have been trying to create a dax measure to dynamically calculate employee headcount every month based on existing staff, new staff and exited staff. HELP!!!

2 ACCEPTED SOLUTIONS

Hi @Osaz,

 

All the staff IDs are unique. In other words, all the IDs are new ID. 

How to define the existing staff, new staff, and existed staff?

 

BTW, don't post private data or sensitive data here.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi Osaz,

 

It's for your privacy and data security. It's up to you to keep or delete the link. 

 

Maybe my guess is correct. Please check out the demo in the Private Message.

New Staff Count = COUNT(MasterList[Staff ID])
Existed Staff =
CALCULATE (
    COUNT ( MasterList[Staff ID] ),
    FILTER (
        ALL ( 'Invoked Function'[Date] ),
        'Invoked Function'[Date] < MIN ( 'Invoked Function'[Date] )
    )
)
Existing Staff =
CALCULATE (
    COUNT ( MasterList[Staff ID] ),
    FILTER (
        ALL ( MasterList ),
        MasterList[DOE] < MIN ( 'Invoked Function'[Date] )
            && (
                MasterList[PRExit Date] > MAX ( 'Invoked Function'[Date] )
                    || ISBLANK ( MasterList[PRExit Date] )
            )
    )
)

Best Regards,

Dale

 

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-jiascu-msft
Employee
Employee

Hi @Osaz,

 

Could you please mark the proper answer as a solution?

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @Osaz,

 

Did you have any issues? What can we help you? It would be great to post a sample of your data. 

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Dale:

 

https://1drv.ms/u/s!AkdGvWz6zLNXg79ihm8T3r8gr3HJYA

 

Thats a link to the file.

 

Osaz

Hi @Osaz,

 

All the staff IDs are unique. In other words, all the IDs are new ID. 

How to define the existing staff, new staff, and existed staff?

 

BTW, don't post private data or sensitive data here.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

all the id's are unique, however, we have a hire date and an exit date. How do I marry the two dates in order to establish employee headcount on any given date.

 

Should I delet the link, though

 

 

Osaz

Hi Osaz,

 

It's for your privacy and data security. It's up to you to keep or delete the link. 

 

Maybe my guess is correct. Please check out the demo in the Private Message.

New Staff Count = COUNT(MasterList[Staff ID])
Existed Staff =
CALCULATE (
    COUNT ( MasterList[Staff ID] ),
    FILTER (
        ALL ( 'Invoked Function'[Date] ),
        'Invoked Function'[Date] < MIN ( 'Invoked Function'[Date] )
    )
)
Existing Staff =
CALCULATE (
    COUNT ( MasterList[Staff ID] ),
    FILTER (
        ALL ( MasterList ),
        MasterList[DOE] < MIN ( 'Invoked Function'[Date] )
            && (
                MasterList[PRExit Date] > MAX ( 'Invoked Function'[Date] )
                    || ISBLANK ( MasterList[PRExit Date] )
            )
    )
)

Best Regards,

Dale

 

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thank you. yeah, will make sure to  review before posting.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.