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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
RanHo
Helper V
Helper V

CALCULATING RENEWED POLICY BASED ON LAST YR PRODUCTION

 

Good day Everyone,

         I had a problem to solve here , I want to get the count/number of renewed policy for this yr based or filtered by the productions last year. I had a sample data here:

Based on my sample I have transaction no which is corresponds on E-No per name.  As you can see there are 3 OLD E-NO records that was came from the E-NO last yr.  So if the TransactionNo has a Old E-No thats the count for Renewed thats whay I had 3 count for renewed.

     Can anyone help me how to solve the logic behind it? Any advice would help. Thanks

SAMPLE DATA.JPG

 

 

3 REPLIES 3
RanHo
Helper V
Helper V

@v-rzhou-msft 

 As I try the codes and measure you suggest, the TOTAL E-NO LAST YR was working , and about the RENEWED one the result is blank, I dont know why but Im investigating what is wrong with the codes, but yeah thanks the one measure is working I'll appreciate that. Thanks

v-rzhou-msft
Community Support
Community Support

Hi @RanHo ,

 

Please try measure as below.

TOTAL E-NO LAST YR =
CALCULATE (
    COUNT ( 'Table'[TRANSACTION NO] ),
    FILTER ( 'Table', YEAR ( 'Table'[ENTRY DATE] ) = YEAR ( TODAY () ) - 1 )
)
RENEWED =
VAR _LASTYEAR_LIST =
    CALCULATETABLE (
        VALUES ( 'Table'[E-NO] ),
        FILTER ( 'Table', YEAR ( 'Table'[ENTRY DATE] ) = YEAR ( TODAY () ) - 1 )
    )
RETURN
    CALCULATE (
        COUNT ( 'Table'[TRANSACTION NO] ),
        FILTER (
            'Table',
            YEAR ( 'Table'[ENTRY DATE] ) = YEAR ( TODAY () )
                && 'Table'[OLD E-NO] IN _LASTYEAR_LIST
        )
    )
PERCENTAGE = DIVIDE([RENEWED],[TOTAL E-NO LAST YR])

Result is as below.

RicoZhou_0-1662098155619.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-rzhou-msft thanks for reply, i will try this and give my feedback.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.