Forum Discussion
Calculate Monthly Retention Performance
Hi
I am new to PowerBI and trying to create a POC for our business requirements.
Attached the dataset and information around the data. Could someone help me in find the monthly retention performance for the product "flex".
| customer_id | product_name | inception_policy_id | effective_start_date | effective_end_date |
| 9515 | flex | 131555 | 05-09-2017 | 05-09-2017 |
| 9515 | flex | 142843 | 27-09-2017 | 27-09-2017 |
| 9515 | flex | 145799 | 02-10-2017 | 02-10-2017 |
| 7863 | flex | 146241 | 03-10-2017 | 03-10-2017 |
| 9515 | flex | 147497 | 05-10-2017 | 05-10-2017 |
| 9515 | flex | 148364 | 06-10-2017 | 06-10-2017 |
| 7863 | flex | 169990 | 08-11-2017 | 08-11-2017 |
| 9515 | flex | 169858 | 08-11-2017 | 08-11-2017 |
| 7863 | flex | 175244 | 13-11-2017 | 13-11-2017 |
| 7863 | flex | 177908 | 16-11-2017 | 16-11-2017 |
| 9515 | flex | 179505 | 17-11-2017 | 17-11-2017 |
| 7863 | flex | 186287 | 23-11-2017 | 23-11-2017 |
| 9515 | flex | 199081 | 05-12-2017 | 05-12-2017 |
| 7863 | flex | 199557 | 06-12-2017 | 06-12-2017 |
| 9515 | flex | 210164 | 19-12-2017 | 19-12-2017 |
| 9515 | flex | 212800 | 22-12-2017 | 22-12-2017 |
| 7863 | flex | 216629 | 29-12-2017 | 29-12-2017 |
| 9515 | flex | 218701 | 02-01-2018 | 02-01-2018 |
| 9515 | flex | 220384 | 04-01-2018 | 04-01-2018 |
| 9515 | flex | 226104 | 11-01-2018 | 11-01-2018 |
| 22597 | flex | 226038 | 11-01-2018 | 11-01-2018 |
| 22597 | flex | 226060 | 11-01-2018 | 11-01-2018 |
| 1991 | flex | 226878 | 12-01-2018 | 12-01-2018 |
| 7863 | flex | 253751 | 03-02-2018 | 03-02-2018 |
| 18820 | flex | 254331 | 03-02-2018 | 03-02-2018 |
| 1991 | rsa | 226878 | 10-01-2018 | 12-01-2018 |
| 7863 | rsa | 253751 | 05-02-2018 | 09-02-2018 |
| 18820 | rsa | 254331 | 08-02-2018 | 09-02-2018 |
Thanks very much.
3 Replies
- Greg_DecklerCommunity Champion
Not sure what retentation performance means exactly. I can think of a number of definitions, what do you use?
Open Tickets might assist, it is designed to work with date intervals. https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364#M147
- v-alq-msftCommunity Support
Hi, karthikponnaih
I wonder the definition of monthly retention performance. If you want to count the number of records where the current month-year is between the start date and the end date and the product name is 'flex', you may try the following steps.
Table:
Calendar:
Calendar = CALENDARAUTO()You may create a calculated column and a measure as below.
Calculated column: Month-Year = VALUE(FORMAT('Calendar'[Date],"yyyymm")) Measure: Result = var _monthyear = SELECTEDVALUE('Calendar'[Month-Year]) var tab = ADDCOLUMNS( ALLSELECTED('Table'), "startmonthyear", VALUE(FORMAT('Table'[effective_start_date],"yyyymm")), "endmonthyear", VALUE(FORMAT('Table'[effective_end_date],"yyyymm")) ) var newtab = ADDCOLUMNS( tab, "flag", IF( _monthyear>=[startmonthyear]&& _monthyear<=[endmonthyear], 1,0 ) ) return COUNTROWS( FILTER( newtab, [flag] = 1&& [product_name] = "flex" ) )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- v-alq-msftCommunity Support
Hi, karthikponnaih
If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.
Best Regards
Allan