Forum Discussion
Calculate retention by month
Hi all,
I am looking to calculate the retention rate of our members. I was wondering if its possible to do it in one and show the % in a Card? Each member has a unique ID and a membership status. Is there a way to write a code that will compare the number of Active UI's on the 1st of the month against the number of UI's at the end of the month and give me the retention %?
Thanks
Jake
3 Replies
- AnonymousNot applicable
Hi MrAtkinson ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure = var _countall= CALCULATE(DISTINCTCOUNT('Table'[UI_ID]), FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(TODAY())&&MONTH('Table'[Date])=MONTH(TODAY()))) var _countactive= CALCULATE(DISTINCTCOUNT('Table'[UI_ID]), FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(TODAY())&&MONTH('Table'[Date])=MONTH(TODAY())&&'Table'[Status]="Active")) return DIVIDE( _countactive,_countall)2. Result:
If it doesn't meet your desired outcome, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- MrAtkinsonFrequent Visitor
Hi,
Thank you for getting back so quickly! This seems like it will do what i need it to do. However i do not have a date option in the data. Is there a way to do this with Calander Date and put it into a bar chart to show month on month?
Thanks
Jake
- AnonymousNot applicable
Hi MrAtkinson ,
Are you saying there is no date format in your data, without a date it is impossible to determine if the data is for the current month, is there any other column instead of a date column to determine the current month or is there some calculation logic.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. help youBest Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.