Forum Discussion

frankhofmans's avatar
frankhofmans
Icon for Helper IV rankHelper IV
5 years ago
Solved

How to present frequent cases

Hi PBI experts,   I have the following problem:   i have a database with sick employees and the sickness date. I want to present the number of sickness cases if:   - a employee is sick 3 times ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi frankhofmans ,

     

    Based on your description, you can create some measures as follows.

    Thanks for amitchandak 's advise.

     

    Test table:

     

    rolling 12 months = CALCULATE(COUNT('Table'[Sickness date]),DATESINPERIOD('Table'[Sickness date],MAX('Table'[Sickness date]),-12,MONTH))




    rolling 6 months = CALCULATE(COUNT('Table'[Sickness date]),DATESINPERIOD('Table'[Sickness date],MAX('Table'[Sickness date]),-6,MONTH))




    Measure 2 =

    var x1=IF(CALCULATE(COUNT('Table'[Sickness date]),DATESINPERIOD('Table'[Sickness date],MAX('Table'[Sickness date]),-12,MONTH))>=4,1)

    var x2=IF(CALCULATE(COUNT('Table'[Sickness date]),DATESINPERIOD('Table'[Sickness date],MAX('Table'[Sickness date]),-6,MONTH))>=3,1)

    return

    x1+x2

     

    Result:

    • Graph:

     

    • Table:

     

    Hope that's what you were looking for.

    Best Regards,

    Yuna

     

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