Forum Discussion

lutur's avatar
lutur
Frequent Visitor
9 years ago
Solved

Deriving Customer churn from data alone

I have a table which records the resources working(nurses or attendants) in patients homes. Each day they work is recorded as a shift. Patient may have multiple resouces working in their homes on a g...
  • MarcelBeug's avatar
    9 years ago

    This is quite complicated. I don't know if it can be done in DAX, but I created something in Power Query in this Excel file.

    (shared from my OneDrive).

     

    With regard to your remark "another day (say End of Previous month)" I created:

    a parameter EndOfPeriodUnit as one of the values from the list PeriodUnits with days, weeks, months, quarters, years

    a parameter NumberOfPeriods for the number of periods to go back

    a function GetPreviousDate to get the previous date, based on a date (Date_Worked) and the 2 parmeters mentioned above).

     

    You can edit the parameters via the option "Manage Parameters"  - "Edit Parameters" on the Home tab of the Query Editor.

    After that, you need to refresh the query to get the results based on the new parameter values.

     

    Query CustomerChurn should do what you want it to; I added some explanatory comments; you can see these in the Advanced Editor.

     

    Probably this is not yet the final result. If you think we're on the right way and if you are confident that you will be able to manage it yourself (eventually), then we can proceed and apply any refinements.