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
Anonymous
Not applicable

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. 
1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
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') ))

Capture.PNG 

 

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.

 

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
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') ))

Capture.PNG 

 

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.

 

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.