Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
romina80
Frequent Visitor

Calculate monthly churn rate on different dimension

Hello,

I'm very new to PowerBi and I'm struggling to find the best solution to calculate a monthly churn rate on different dimensions.

I have my dataset as follows:

MonthContract statusmovement typeactual
Jan-25OOCVoluntary10
Jan-25ICVoluntary2
Jan-25OOCPorts15
Jan-25ICPorts3
Jan-25OOCClosing Base100
Jan-25ICClosing Base300

 

and I want to build a trend report to show the churn rate by contract status and by movement type.

The calculation should be:

MonthContract statusChurn rateFormula
Jan-25OOC0.25(10+15)/100
Jan-25IC0.016666667(2+3)/300
    
    
    
MonthMovement typeChurn rateFormula
Jan-25Voluntary0.03(10+2)/(100+300)
Jan-25Ports0.045(15+3)/(100+300)

 

Is there an easy way to calculate or do I need to modify my dataset and try to bring the Closing Base values in the same rows as the churn values?

 

Thanks for the help

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@romina80 

You need to create calculated columns to separate the churn values and the closing base values.

ChurnValue = IF(
[movement type] IN {"Voluntary", "Ports"},
[actual],
BLANK()
)

 

 Create a calculated column to identify closing base values:

ClosingBaseValue = IF(
[movement type] = "Closing Base",
[actual],
BLANK()
)

 

Create measures to calculate the churn rate.

DAX
TotalChurnByContractStatus = CALCULATE(
SUM('Table'[ChurnValue]),
ALLEXCEPT('Table', 'Table'[Month], 'Table'[Contract status])
)

 

DAX
TotalClosingBaseByContractStatus = CALCULATE(
SUM('Table'[ClosingBaseValue]),
ALLEXCEPT('Table', 'Table'[Month], 'Table'[Contract status])
)

 

DAX
ChurnRateByContractStatus = DIVIDE(
[TotalChurnByContractStatus],
[TotalClosingBaseByContractStatus]
)

 

DAX
TotalChurnByMovementType = CALCULATE(
SUM('Table'[ChurnValue]),
ALLEXCEPT('Table', 'Table'[Month], 'Table'[movement type])
)

 

DAX
TotalClosingBase = CALCULATE(
SUM('Table'[ClosingBaseValue]),
ALLEXCEPT('Table', 'Table'[Month])
)

 

DAX
ChurnRateByMovementType = DIVIDE(
[TotalChurnByMovementType],
[TotalClosingBase]
)

 

Churn Rate by Contract Status:

Create a table or chart visual.
Add Month, Contract status, and ChurnRateByContractStatus to the visual.
Churn Rate by Movement Type:

Create a table or chart visual.
Add Month, movement type, and ChurnRateByMovementType to the visual.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

3 REPLIES 3
AthmakuriRekha
Frequent Visitor

Hi @romina80 ,

Here is my solution. 

I have created 2 tables, one has ports and voluntry filtered data and other has closing base. Please find below dax queries. Created new custom column to establish relationship combining month and contractstatus.

Dax 1: 

let
Source = Sql.Database(server, dbname),
dbo_churn = Source{[Schema="dbo",Item="churn"]}[Data],
#"Filtered Rows" = Table.SelectRows(dbo_churn, each ([movementtype] <> "Closing Base")),
#"Added Custom" = Table.AddColumn(#"Filtered Rows", "Custom", each [MONTH]+[Contractstatus])
in
#"Added Custom"

 

Dax 2 :

let
Source = Sql.Database(server,dbname),
dbo_churn = Source{[Schema="dbo",Item="churn"]}[Data],
#"Filtered Rows" = Table.SelectRows(dbo_churn, each ([movementtype] = "Closing Base")),
#"Added Custom" = Table.AddColumn(#"Filtered Rows", "Custom", each [MONTH]+[Contractstatus])
in
#"Added Custom"

Now create table in the report and add a custom function to calculate ChurnRate as below. From Home tab add new visual calculation add custom function. 

 

AthmakuriRekha_2-1742459343314.png

 

similarly calculate the movement type churnrate as well as below.

AthmakuriRekha_3-1742459373437.png

 

Please accept the solution if this answers your question. Let us know if still have any concerns.
Thanks !!

 

bhanu_gautam
Super User
Super User

@romina80 

You need to create calculated columns to separate the churn values and the closing base values.

ChurnValue = IF(
[movement type] IN {"Voluntary", "Ports"},
[actual],
BLANK()
)

 

 Create a calculated column to identify closing base values:

ClosingBaseValue = IF(
[movement type] = "Closing Base",
[actual],
BLANK()
)

 

Create measures to calculate the churn rate.

DAX
TotalChurnByContractStatus = CALCULATE(
SUM('Table'[ChurnValue]),
ALLEXCEPT('Table', 'Table'[Month], 'Table'[Contract status])
)

 

DAX
TotalClosingBaseByContractStatus = CALCULATE(
SUM('Table'[ClosingBaseValue]),
ALLEXCEPT('Table', 'Table'[Month], 'Table'[Contract status])
)

 

DAX
ChurnRateByContractStatus = DIVIDE(
[TotalChurnByContractStatus],
[TotalClosingBaseByContractStatus]
)

 

DAX
TotalChurnByMovementType = CALCULATE(
SUM('Table'[ChurnValue]),
ALLEXCEPT('Table', 'Table'[Month], 'Table'[movement type])
)

 

DAX
TotalClosingBase = CALCULATE(
SUM('Table'[ClosingBaseValue]),
ALLEXCEPT('Table', 'Table'[Month])
)

 

DAX
ChurnRateByMovementType = DIVIDE(
[TotalChurnByMovementType],
[TotalClosingBase]
)

 

Churn Rate by Contract Status:

Create a table or chart visual.
Add Month, Contract status, and ChurnRateByContractStatus to the visual.
Churn Rate by Movement Type:

Create a table or chart visual.
Add Month, movement type, and ChurnRateByMovementType to the visual.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hello @bhanu_gautam ,

thanks for the help your solution is working fine.

I have another challenge because the churn rate has to be calculated using the average between the current month and previous month closing base. I will do another post for that. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.