Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
willdiles
Frequent Visitor

Calculating the Sum of Appointment Duration Within 30 Days of Sale

I have two tables, _SalesTable (all sales transactions) and _AppointmentsTable (all appointments) and a separate date table. Their is a unique identifier for patients ( Patient ID) that exists as a column in both tables. In the appointments table there is a column called "Duration" which is the number of minutes for each appointment.

 

I am trying to create a measure that would calculate the sum of "_AppointmentsTable[Duration]" of all appointments for any given patient within 30 days prior to the sale date and 30 days after. The end goal is to be able to calculate the revenue/profit generated per clinical hour. We need to know how much time was spent with each patient to generate the sale in order to do this.

 

Here are the columns for the tables mentioned above:

_SalesTable

Sales DatePatient IDItemRevenueQty

 

_ApptTable

Appt DatePatient IDCompletedDuration

 

Any help would be greatly appreciated.

1 REPLY 1
tamerj1
Super User
Super User

Hi @willdiles 

please provide sameple data

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.