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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
tzaveri
New Member

Count ex-members (TIN) based on MembershipEndDate

Looking to get count of ex-members (using their TIN in TIN column) from last 24 months based on MembershipEndDate.

 

tzaveri_0-1694028157827.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tzaveri,

Here is the measure formula that can get rolling 2 year records and get distinct member count, you can try it if it suitable for your requirement.

formula =
VAR currDate =
    MAX ( Table1[MembershipEndDate] )
RETURN
    CALCULATE (
        COUNTROWS ( VALUES ( Table1[TIN] ) ),
        FILTER (
            ALLSELECTED ( Table1 ),
            [MembershipEndDate]
                >= DATE ( YEAR ( currDate ) - 2, MONTH ( currDate ), DAY ( currDate )
                    && [MembershipEndDate] <= currDate )
        )
    )

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @tzaveri,

Here is the measure formula that can get rolling 2 year records and get distinct member count, you can try it if it suitable for your requirement.

formula =
VAR currDate =
    MAX ( Table1[MembershipEndDate] )
RETURN
    CALCULATE (
        COUNTROWS ( VALUES ( Table1[TIN] ) ),
        FILTER (
            ALLSELECTED ( Table1 ),
            [MembershipEndDate]
                >= DATE ( YEAR ( currDate ) - 2, MONTH ( currDate ), DAY ( currDate )
                    && [MembershipEndDate] <= currDate )
        )
    )

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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