Forum Discussion

mgaut341's avatar
mgaut341
Helper II
2 years ago

PowerBi Measure for Appointment types

I am trying to create a measure looking at the no show rate for appointment types.

For my numerator I have the number of no shows appointments that were documented. I think I need to add the appointment types I am looking for- Vaccine, same day vaccine, and flu vaccine, as I only want the no show rate for these appointment types.

 

No Show Numerator =
CALCULATE(DISTINCTCOUNT('New Appointment_Fact'[apptid]), 'New Appointment_Fact'[apptslotstatus]="x - Cancelled")
 

The denominator is where I run into problems. I want to create a denominator that counts all the appointment slot statuses, however, I only want it to count for the appointment types that are 'vaccine', 'flu vaccine', and 'same day vaccine'. I have tried using the following formula but the results are not accurate as it takes in all appointment types and not only the three desired. How should I change my denominator formula?

 

CALCULATE(DISTINCTCOUNT('New Appointment_Fact'[prnt apptid]), 'New Appointment_Fact'[appttype]="Vaccine", 'New Appointment_Fact'[appttype]="Same Day Vaccine", 'New Appointment_Fact'[apptslotstatus]="4 - Charge Entered", 'New Appointment_Fact'[apptslotstatus]= "f - Filled", 'New Appointment_Fact'[apptslotstatus]= "2 - Checked In", 'New Appointment_Fact'[apptslotstatus]= "3 - Checked Out" || 'New Appointment_Fact'[apptslotstatus] = "x - Cancelled") + CALCULATE(DISTINCTCOUNT('New Appointment_Fact'[apptid]), 'New Appointment_Fact'[apptslotstatus] = "o - Open Slot")

2 Replies

  • mgaut341 , Try like

     

    CALCULATE(DISTINCTCOUNT('New Appointment_Fact'[prnt apptid]), filter('New Appointment_Fact', 'New Appointment_Fact'[appttype] in {"Vaccine",,"Same Day Vaccine"} && 'New Appointment_Fact'[apptslotstatus] in {"4 - Charge Entered", "f - Filled", "2 - Checked In", "3 - Checked Out" , "x - Cancelled"})) + CALCULATE(DISTINCTCOUNT('New Appointment_Fact'[apptid]), filter('New Appointment_Fact','New Appointment_Fact'[apptslotstatus] = "o - Open Slot"))

  • Thank you, that worked!! 

    Do you believe I need to change my numerator to only include the appointment types of interest?