Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 Date | Patient ID | Item | Revenue | Qty |
_ApptTable
Appt Date | Patient ID | Completed | Duration |
Any help would be greatly appreciated.