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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.