Forum Discussion
jdb0912
3 years agoNew Member
Calculated column not referencing original entry properly
Hi everyone, I wasn't sure how to really title the exact issue I was facing, so I explained it as best as I could below. I'm trying to calculate bed days, then associate the insurance informa...
- 3 years ago
Hi jdb0912
First of all you should establish two inactive relationship: between Admit Date and Calendar and Discharge Date and Calendar.
Then, you can calculate active beds (with this formula you also check if discharge date is empty in case the patient is still on it:
Active beds= CALCULATE(DISTINCTCOUNT('Table'[Visit ID]), FILTER('Table','Table'[Admit Date]<=MAX('Calendar'[Fechas]) && OR('Table'[Discharge Date] >=MAX('Calendar'[Fechas]),ISBLANK('Table'[Discharge Date]))))And now, you can display it in a matrix:
- 3 years ago
Then, add a new measure:
Sum of bed days= SUMX(CalendarTable,[Active beds])
jdb0912
3 years agoNew Member
I'd need a sum of the bed days.