Forum Discussion

Mamoun_issa's avatar
Mamoun_issa
Frequent Visitor
6 years ago
Solved

Same patients visit in same day

Hello

 

I Have patients visits schedule that have the details of the visits and the procedure done in each visits, I neet to diffrentiate visits that have same day visit the data look something like this 

 

Visit NumberPatient NamePatient NumberVisit DateProcedures DoenVisit Type
1001JosephMR20010 Januray 2019AOP
1001JosephMR20010 Januray 2019BOP
1001JosephMR20010 Januray 2019COP
1012JosephMR20010 Januray 2019X IP
1012JosephMR20010 Januray 2019YIP
1012JosephMR20010 Januray 2019ZIP

 

I want to add a coulmn to specify wethed patient have a visit in the same day or not

 

Regards,

  • Hi Mamoun_issa ,
    Please try this:

    Same Day =
    CALCULATE (
        DISTINCTCOUNT ( myTable[Visit Number] ),
        ALLEXCEPT ( myTable, myTable[Patient Number], myTable[Visit Date] )
    )

     

     

1 Reply

  • Nathaniel_C's avatar
    Nathaniel_C
    Community Champion

    Hi Mamoun_issa ,
    Please try this:

    Same Day =
    CALCULATE (
        DISTINCTCOUNT ( myTable[Visit Number] ),
        ALLEXCEPT ( myTable, myTable[Patient Number], myTable[Visit Date] )
    )