Forum Discussion
frankhofmans
Helper IV
5 years agoHow 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 ...
- Anonymous5 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+x2Result:
- 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.
amitchandak
Super User
5 years agofrankhofmans , Try with help from date table
Rolling 6 = CALCULATE(sum(Table[Sickness date]),DATESINPERIOD('Date'[Date ],MAX(Table[Sickness Date]),-6,MONTH))
Rolling 12 = CALCULATE(sum(Table[Sickness date]),DATESINPERIOD('Date'[Date ],MAX(Table[Sickness Date]),-12,MONTH))
- frankhofmans5 years ago
Helper IV
Hi Amitchandak,
If i generate your measure or calculated colums, i get only results with value 1. Do you have an example for me?
Thanks in advance,
Regards, Frank