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
Anonymous
Not applicable

Counting days off per person

Hello all.

 

I have a data-set that looks like the below. I have labelled the table names (obviously the real data-set is much bigger).

 

I have the absences for each user, on a per month basis. 

 

What I need to do is be able to track working days per month per person over time using a piece of DAX - can anyone help please?

 

Thanks


Adam

pbi help.JPG

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

Assuming the absence table has month year and only one record per month per employee.

 

You can get no of working days in  the absence  table

 

Working days = countx(filter(datetable,datetable[Is Working Day] ="TRUE" && format(datetable[date],"MMMM-YYYY")=absence[month]),datetable[date])

 

View solution in original post

Hi @Anonymous ,

 

check this quick an dirty PBIX 😁

 

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could refer to the following DAX:

Measure =
CALCULATE (
    COUNT ( 'Date Table'[Date] ),
    ALLSELECTED ( 'Date Table' ),
    FILTER ( 'Date Table', 'Date Table'[Is Working Day] = TRUE () )
)
    - CALCULATE (
        SUM ( 'Absences Table'[Days Off] ),
        USERELATIONSHIP ( 'User Table'[Name], 'Absences Table'[Name] )
    )

 

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

Hi @Anonymous ,

 

check this quick an dirty PBIX 😁

 

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


amitchandak
Super User
Super User

Assuming the absence table has month year and only one record per month per employee.

 

You can get no of working days in  the absence  table

 

Working days = countx(filter(datetable,datetable[Is Working Day] ="TRUE" && format(datetable[date],"MMMM-YYYY")=absence[month]),datetable[date])

 

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.