Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Multiple dates within 1 dataset

Hi guys,

 

I have a dataset that looks like this: 

 

Policy NumberPolicy Start DateCancellation Date
12301/01/201905/05/2019
23402/02/201906/06/2019
34503/03/201906/06/2019
45604/04/2019"" (Blank)

 

I want to be able to create a measure that allows me to calculate a cancellation rate based on the above table. 

 

Currently, I have the following formula: 

 

Cancellation Rate = DIVIDE ( SUM ( Cancelled ) , CALCULATE ( COUNT ( Policy Number ) )
when Cancelled = IF ( ISBLANK( Cancellation Date ) , 0 , 1)
 
When I use the above measure, it gives me 100% conversion rate since it is only taking the policies that have been cancelled when I use the cancellation date as the x-axis.  
 
I have tried 
Cancellation Rate = DIVIDE ( SUM ( Cancelled ) , CALCULATE ( COUNT ( Policy Number ) , ALL ( [Policy Start Date]) )
but it doesn't give me the correct policy number. 
 
Ideally, I want Policy Start Date as the x-axis and have the number of policies reflecting the Policy Start Date and also have the Cancelled Date count to sync / coincide with the Policy Start Date as a count. I want to see all the policies that were bought in January and the number of policies that were cancelled in the January also. 
  • Anonymous ,

     

    Use ALL(Table) instead of ALL(Table[Column]) as below:

    Cancellation Rate = DIVIDE ( SUM ( [Cancelled] ) , CALCULATE ( COUNT ( 'Table'[Policy Number] ) , ALL ( 'Table') ))
    

     

     

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

1 Reply

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    Anonymous ,

     

    Use ALL(Table) instead of ALL(Table[Column]) as below:

    Cancellation Rate = DIVIDE ( SUM ( [Cancelled] ) , CALCULATE ( COUNT ( 'Table'[Policy Number] ) , ALL ( 'Table') ))
    

     

     

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.