Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello everyone!
I try to calculate the migration rate of credits in the "DEP" state during a year.
For this I need to check the evolution of the clients who were in the "CUR" state at the beginning of the year and became "DEP".
New customers may appear during a year (example: 105 and 106). These should not be taken into account.
If a customer with the status "CUR" has become at least once "DEP" he will be considered "DEP" at the end of the year.
The client migration rate, in the "DEP" state, is calculated as follows:
Number of customers who entered the "DEP" state during a year / Total number of customers who were "CUR" at the beginning of the year.
-> 4/5 = 0.8
How can I do this calculation in PowerBi?
Solved! Go to Solution.
Hello, @ANM_97
According to your description, I created data to reproduce your scenario. The pbix file is attached at the end.
Mesa:
You can create a measure as follows.
Migration Rate =
var tab =
SUMMARIZE(
'Table',
'Table'[Customer ID],
"Flag1",
IF(
COUNTROWS(
FILTER(
'Table',
'Table'[State]=BLANK()
)
)>0,
0,1
)
)
var newtab =
ADDCOLUMNS(
tab,
"Flag2",
IF(
COUNTROWS(
FILTER(
ALL('Table'),
'Table'[Customer ID]=EARLIER('Table'[Customer ID])&&
[State]="CUR"
)
)=
COUNTROWS(
FILTER(
ALL('Table'),
'Table'[Customer ID]=EARLIER('Table'[Customer ID])
)
),0,1
)
)
return
DIVIDE(
COUNTROWS(
FILTER(
newtab,
[Flag1]=1&&
[Flag2]=1
)
),
COUNTROWS(
FILTER(
newtab,
[Flag1]=1
)
)
)
Result:
Best regards
Allan
If this post helps,then consider Accepting it as the solution to help other members find it faster.
Hello, @ANM_97
According to your description, I created data to reproduce your scenario. The pbix file is attached at the end.
Mesa:
You can create a measure as follows.
Migration Rate =
var tab =
SUMMARIZE(
'Table',
'Table'[Customer ID],
"Flag1",
IF(
COUNTROWS(
FILTER(
'Table',
'Table'[State]=BLANK()
)
)>0,
0,1
)
)
var newtab =
ADDCOLUMNS(
tab,
"Flag2",
IF(
COUNTROWS(
FILTER(
ALL('Table'),
'Table'[Customer ID]=EARLIER('Table'[Customer ID])&&
[State]="CUR"
)
)=
COUNTROWS(
FILTER(
ALL('Table'),
'Table'[Customer ID]=EARLIER('Table'[Customer ID])
)
),0,1
)
)
return
DIVIDE(
COUNTROWS(
FILTER(
newtab,
[Flag1]=1&&
[Flag2]=1
)
),
COUNTROWS(
FILTER(
newtab,
[Flag1]=1
)
)
)
Result:
Best regards
Allan
If this post helps,then consider Accepting it as the solution to help other members find it faster.
Thank you ! @v-alq-msft
I don't think I did well. I should get about 3% on the original data, but I get 99% if I apply this measure.
Hi, @ANM_97
You may replace the 'ALL' with 'ALLSELECTED' to see if it works.
Migration Rate =
var tab =
SUMMARIZE(
'Table',
'Table'[Customer ID],
"Flag1",
IF(
COUNTROWS(
FILTER(
'Table',
'Table'[State]=BLANK()
)
)>0,
0,1
)
)
var newtab =
ADDCOLUMNS(
tab,
"Flag2",
IF(
COUNTROWS(
FILTER(
ALLSELECTED('Table'),
'Table'[Customer ID]=EARLIER('Table'[Customer ID])&&
[State]="CUR"
)
)=
COUNTROWS(
FILTER(
ALLSELECTED('Table'),
'Table'[Customer ID]=EARLIER('Table'[Customer ID])
)
),0,1
)
)
return
DIVIDE(
COUNTROWS(
FILTER(
newtab,
[Flag1]=1&&
[Flag2]=1
)
),
COUNTROWS(
FILTER(
newtab,
[Flag1]=1
)
)
)
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'm not getting the right result.
Two measures could be built:
1. Save the number of clients with "CUR" status at the beginning of the period.
2. Save the number of clients who had "CUR" status at the beginning of the period, but became "DEP" at least once during a year.
The migration rate will be:
the number of clients who have had "DEP" status at least once during a year, divided by the number of clients with "CUR" status at the beginning of the period.
I know how to identify those who were in the "CUR" state at the beginning of the period, but how can I see which of them entered the "DEP" state and count them, without taking into account the new customers that appeared during the year..
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 70 | |
| 55 | |
| 38 | |
| 28 | |
| 22 |
| User | Count |
|---|---|
| 133 | |
| 119 | |
| 54 | |
| 37 | |
| 31 |