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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sudheerbolla
Helper II
Helper II

how to populate same value to all the records of a policy no, based on a value in another column

Hi everyone,

@amitchandak , @danextian , @Ritaf1983 , @truptis 

 

Could you help in writing a DAX function in populating same value for all the records of a policy no in new calculated coumn based on a value in another column.

If there is a record with  Event Code = "cancel_policy" or "cancel_policy_non_payment", in the multiples records of a same policy no, then "cancelled" to be populated in calculated column against all the records of the cancelled policy.

Else, "Active" to be populated in the in all the records of the policy as shown below.

 

sudheerbolla_0-1689812510276.png

 

 

Link of the sample data is below.

https://www.dropbox.com/scl/fi/m3v5tww6jq45uugn725pf/data-Copy.xlsx?rlkey=m7crl4y52qpx850qcfjt3f3gh&...

 

Thank you in advance.

 

1 ACCEPTED SOLUTION
VilmarSch
Post Patron
Post Patron

Veja se ajuda

Act/Cancel = 
VAR Var1 =
    COUNTROWS (
        FILTER (
            Tabela,
            [Policy No] = EARLIER ( Tabela[Policy No] ) && 
            ( [Event Code] = "cancel_policy" || [Event Code] = "cancel_policy_non_payment" )
        )
    )
RETURN
    IF ( Var1 = BLANK (), "Active", "Cancelled" )

 

Captura de tela 2023-07-19 223630.jpg

View solution in original post

3 REPLIES 3
sudheerbolla
Helper II
Helper II

I appreciate you.

 

I got struck in middle of the way, could you please solve this. I worked on finding the buckets of increase in premium resulting in cancellation of policies. 

I working on to find the renteniton of the customers with increase in premium. for this i want to populate the values of current term and previous term of the latest renewal only. 

Need help in writing Dax Function in getting value... - Microsoft Fabric Community

sudheerbolla
Helper II
Helper II

Thank you.

 

VilmarSch
Post Patron
Post Patron

Veja se ajuda

Act/Cancel = 
VAR Var1 =
    COUNTROWS (
        FILTER (
            Tabela,
            [Policy No] = EARLIER ( Tabela[Policy No] ) && 
            ( [Event Code] = "cancel_policy" || [Event Code] = "cancel_policy_non_payment" )
        )
    )
RETURN
    IF ( Var1 = BLANK (), "Active", "Cancelled" )

 

Captura de tela 2023-07-19 223630.jpg

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.