Forum Discussion
MIrlam
4 years agoFrequent Visitor
Calculating Occupied beds across multiple months
Hi all I have a table with date of admission and date of discharge in it. I can calculate the bed occupancy quite easily for people who arrive and leave in the same month. I have custom columns t...
- Anonymous4 years ago
Hi MIrlam ,
Here are the steps you can follow:
1. Create calculated column.
Flag = DATEDIFF(EOMONTH('Table'[date_hospitalized],-1)+1,EOMONTH('Table'[date_Discharged],0),MONTH)day = IF('Table'[Flag] >=2,DATEDIFF('Table'[date_hospitalized],'Table'[date_Discharged],DAY),0)2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Anonymous
4 years agoNot applicable
Hi MIrlam ,
Here are the steps you can follow:
1. Create calculated column.
Flag = DATEDIFF(EOMONTH('Table'[date_hospitalized],-1)+1,EOMONTH('Table'[date_Discharged],0),MONTH)day =
IF('Table'[Flag] >=2,DATEDIFF('Table'[date_hospitalized],'Table'[date_Discharged],DAY),0)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly