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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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