Hello,
I am new to using Power Bi. Any help would be highly appreciated.
I have the same patient listed several times since every hour we are checking if they are on medication. I have the hospital hours which is basically the difference between the admit and discharge date (in hours). While summarizing the on_med, i need to consider the hosp_hours field only once per patient (its repeating currently). I have shown only 2 patients here for simplicity but i have around 1000 patients in my data.
HAVE
patient admit_date discha_date on_med hosp_hrs
pat1 Dec20,2016 4:20pm Dec21,2016 4:20pm 0 24
pat1 Dec20,2016 4:20pm Dec21,2016 4:20pm 1 24
pat1 Dec20,2016 4:20pm Dec21,2016 4:20pm 1 24
pat1 Dec20,2016 4:20pm Dec21,2016 4:20pm 1 24
pat2 Dec20,2016 4:20pm Dec21,2016 4:20am 0 12
pat2 Dec20,2016 4:20pm Dec21,2016 4:20am 1 12
WANT
patient on_med hosp_hrs percent_hours
pat1 3 24 3/24*100= 12.5%
pat2 1 12 3/24*100= 8.3%
TOTAL 4 36 4/36*100=11.11%