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
atul9063
Helper III
Helper III

Calculate Retain Customer

Hi,

 

I want help in calculating retained users :

 

Output 

monthCount of retain Users
Jan4
Feb2
Mar3

 

Dataset 

DateUseritemid 
1/1/20181
1/2/20182
1/3/20183
1/4/20186
2/10/20181
2/11/20183
2/12/201810
2/13/20183
2/14/20181
2/15/201811
3/15/20181
3/16/20182
3/17/20183
3/18/201810
3/19/201814
1 ACCEPTED SOLUTION

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@atul9063

 

try this

 

Create a calendar table and then this MEASURE

 

Measure =
VAR PreviousMonthUsers =
    CALCULATETABLE (
        DISTINCT ( Table1[Useritemid ] ),
        PREVIOUSMONTH ( Table1[Date] )
    )
VAR CurrentMonthUsers =
    DISTINCT ( Table1[Useritemid ] )
RETURN
    IF (
        ISEMPTY ( PreviousMonthUsers ),
        COUNTROWS ( CurrentMonthUsers ),
        COUNTROWS ( INTERSECT ( PreviousMonthUsers, CurrentMonthUsers ) )
    )

@Zubair_MuhammadThanks for quick response 

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! Prices go up Feb. 11th.

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.

Jan NL Carousel

Fabric Community Update - January 2025

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