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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.