Forum Discussion
pui
3 years agoFrequent Visitor
Array formula in DAX
I have some patients data in a hospital with admission date and discharge date. I need to calculate how many patients are in the hospital on each day. Sample data and expected output as below, I pr...
- 3 years ago
Hi,
Please check the below picture and the attached pbix file.
No of patients measure: = COUNTROWS ( FILTER ( Data, Data[Admission date (dd/mm/yyyy)] <= MAX ( 'Calendar'[Date] ) && OR ( Data[Discharged date (dd/mm/yyyy)] > MIN ( 'Calendar'[Date] ), Data[Discharged date (dd/mm/yyyy)] = BLANK () ) ) )
Jihwan_Kim
3 years agoSuper User
Hi,
Please check the below picture and the attached pbix file.
No of patients measure: =
COUNTROWS (
FILTER (
Data,
Data[Admission date (dd/mm/yyyy)] <= MAX ( 'Calendar'[Date] )
&& OR (
Data[Discharged date (dd/mm/yyyy)] > MIN ( 'Calendar'[Date] ),
Data[Discharged date (dd/mm/yyyy)] = BLANK ()
)
)
)