cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

ABSENTEEISM TREND

I need to show the plant historical absenteeism trend in bar w/ illness etc. breakdown. Below, I've put a simple table, actually my data has more coloumns.

For example

- Janury 1st, value of bar chart will be 2, since 2 employees are absent.

- Janury 2nd, again 2

- Janury 3rd, it will be 3 and so on

 

My data has more than 50 K records after 2010. I could not find an easy way and need experts help 🤗

Any DAX, visual or etc suggests are wellcome.

 

EMPLOYEE NAME - ABS Start Time - ABS End Time - Illness
A - 1.01.2020 - 5.01.2020 - Infection
B - 1.01.2020 - 7.01.2020 - Musculoskeletal
C - 3.01.2020 - 10.01.2020 - Other
D - 5.01.2020 - 17.01.2020 - Musculoskeletal
B - 10.01.2020 - 20.01.2020 - Musculoskeletal
E - 21.01.2020 - 25.01.2020 - Infection
C - 20.01.2020 - 2.02.2020 - Musculoskeletal
A -18.01.2020 - 31.01.2020 - Infection
F - 3.01.2020 - 15.02.2020 - Other

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: ABSENTEEISM TREND

Hi, @BBASARAN 

 

You may modify the measure as below.

Absent Num = 
var _date = SELECTEDVALUE('Calendar'[Date])
var tab = 
SUMMARIZE(
    'Table',
    'Table'[Employee Name],
    'Table'[ABS Start Time],
    'Table'[ABS End Time],
    'Table'[Illness],
    "flag",
    var _starttime = 'Table'[ABS Start Time]
    var _endtime = 'Table'[ABS End Time]
    return
    IF(
       _date>=_starttime&&_date<=_endtime,
       1,
       0
    )
)
return 
CALCULATE(
    DISTINCTCOUNT('Table'[Employee Name]),
    FILTER(
        tab,
        [flag] = 1
    )
)

 

Then you can use 'Stacked column chart' to display the result.

e1.png

 

Best Regards

Allan

 

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

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: ABSENTEEISM TREND

Hi, @BBASARAN 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

d1.png

 

Calendar(a calculated table):

Calendar = CALENDARAUTO()

 

There is no relationship between two tables. You may create a measure as below. 

Absent Num = 
var _date = SELECTEDVALUE('Calendar'[Date])
var tab = 
SUMMARIZE(
    ALL('Table'),
    'Table'[Employee Name],
    'Table'[ABS Start Time],
    'Table'[ABS End Time],
    'Table'[Illness],
    "flag",
    var _starttime = 'Table'[ABS Start Time]
    var _endtime = 'Table'[ABS End Time]
    return
    IF(
       _date>=_starttime&&_date<=_endtime,
       1,
       0
    )
)
return 
CALCULATE(
    DISTINCTCOUNT('Table'[Employee Name]),
    FILTER(
        tab,
        [flag] = 1
    )
)

 

For 1/1/2020 and 1/2/2020, there are employees including A,B. For1/3/2020, there are employees including A,B,C,F. Here is the result.

d2.png

 

Best Regards

Allan

 

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

Highlighted
Regular Visitor

Re: ABSENTEEISM TREND

@v-alq-msft thank you for your reply.

 

As I said, ı want to see daily absenteeism with illness breakdown in stacked coloumn. Your data shows daily absenteeism without breakdown.

Highlighted
Community Support
Community Support

Re: ABSENTEEISM TREND

Hi, @BBASARAN 

 

You may modify the measure as below.

Absent Num = 
var _date = SELECTEDVALUE('Calendar'[Date])
var tab = 
SUMMARIZE(
    'Table',
    'Table'[Employee Name],
    'Table'[ABS Start Time],
    'Table'[ABS End Time],
    'Table'[Illness],
    "flag",
    var _starttime = 'Table'[ABS Start Time]
    var _endtime = 'Table'[ABS End Time]
    return
    IF(
       _date>=_starttime&&_date<=_endtime,
       1,
       0
    )
)
return 
CALCULATE(
    DISTINCTCOUNT('Table'[Employee Name]),
    FILTER(
        tab,
        [flag] = 1
    )
)

 

Then you can use 'Stacked column chart' to display the result.

e1.png

 

Best Regards

Allan

 

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

Highlighted
Regular Visitor

Re: ABSENTEEISM TREND

it works. Thank you for your reply.

 

Is there a way to sum that measure between 2 given dates?

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors