Forum Discussion

jialiang's avatar
jialiang
New Member
9 years ago

How to get lost customers over a date range?

Hi guys, I am currently trying out Pbi and evaluating it for my company. I have a test case that I cannot seem to work out. I am not fluent in DAX or Pbi. 

 

This is a snapshot of my data. What I would like to do is:

 

 

canumgb_contracttypegb_salesmancodebillcyclestartdateenddatecustomergb_veh_subgroupgb_subgroupcode
LCVL156123 salesman aMONTHLY15/8/201614/8/2018C00013958 1.3
LCVL789465 salesman bMONTHLY1/4/201428/2/2017C00008742BUSTVD
LCV456123 salesman aMONTHLY26/3/201425/3/2017C00003097BUSTVD

 

Show on a dashboard, the number of active contracts in a day in the form of a line chart. For e.g, 14/8/16 - 2000 active contracts, 15/8/16 - 2001 active contracts.

 

I then want to be able to drill down and find that one contract we gained, who is the salesman and what is the subgroup of the vehicle sold. 

 

-End

 

So far I have not been able to find examples on lost customers by evaluating their status (active or non-active) over a date range. 

 

Any help would be greatly appreciated. Thank you.

4 Replies

  • THERE ARE COUPLE OF QUESTIONS YOU SHOULD MAKE IT CLEAR BEFORE ANSWERING YOUR QUESTION

    1.How do you define the particular contract is active or inactive. Is there any criteria?

    2. Is there any business logic that identifies the lost customers?

    3. it would be better to share dimensions table in your data model as well which will make your question more clear.

     

     

    • jialiang's avatar
      jialiang
      New Member
      Sorry for missing these points out.
      1. Ideally my X-axis has a range of dates, could be any 7 days i input in my filter. For each day in my x-axis, if my [start date] <= the date, and [end date] > the date then it's considered active. Anything outside of this range is considered inactive.
      2.Lost customers are those contracts that were present during the start of the date range and by the end of the specified date range is no longer present.
      3. i don't understand what you mean by dimensions table.

      Thanks in advance.
  • Anonymous's avatar
    Anonymous
    Not applicable

    Show on a dashboard, the number of active contracts in a day in the form of a line chart. For e.g, 14/8/16 - 2000 active contracts, 15/8/16 - 2001 active contracts.

     

    I then want to be able to drill down and find that one contract we gained, who is the salesman and what is the subgroup of the vehicle sold. 

     

     


    Hi jialiang

    Add a calendar table in your scenario, then create the following measure, then create a line chart using date column in calendar table and the measure .

    Active contracts =
      COUNTROWS(
        FILTER( Table1, Table1[startdate]<= MIN('Date'[DateKey]) && Table1[enddate] >= MAX('Date'[DateKey]) )
      )

    In addition, it is not possible to directly dill down from the line chart to get details of the active contracts, but you can create a table visual as follows, and drag the measure to visual level filter of the table and set the value to be greater than 0. Moreover, you can create a date slicer to filter table visual and line chart. For more deatils, please review this attached PBIX file.



    Thanks,
    Lydia Zhang