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
djbuncle
Helper I
Helper I

Calculating Retained In Consecutive Months

Hi.

I'm trying to calculate the count of players who have deposited in consecutive months (when slicing on any given month).

I have a fact table which can have multiple deposits per day containing a [PlayerId] and [DepositDate].

Some metrics I already have setup here are the

[Total Depositors] = DISTINCTCOUNT(Deposits[PlayerId])

[First Time Depositors] = CALCULATE(COUNTROWS(Deposits), Deposits[IsFirstDeposit]=1)

[Retained] = [Depositors]-[FTDs]

DesiredOutput20191009.jpg

The requirement for [Consecutive Depositor] is the count of players that have deposited in consecutive months (not just any previous month). 

So I'm guessing it's somewhere along the lines of := SUMX( Distinct count of PlayerId where depositor in current month and previous month)

It's evaluating whether the particular player has deposited in the previous month that is beyond my DAX capabilities. The highlighted column would be the desired output.

 

Thanks

Dave

2 REPLIES 2
amitchandak
Super User
Super User

Please find the sample below

 

Continous Months = CALCULATE(DISTINCTCOUNT('Date'[Format Month]),DATESINPERIOD('Date'[Date Filer],STARTOFMONTH(dateadd('Date'[Date Filer],-2,MONTH)),2,MONTH))

Based on no of month change -2 (-1*month value)

 

This number should be equal month value for continuous data.

I have used a formatted month to count of month year. That can be replaced with other options.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks @amitchandak  but this doesn't really address counting the specific players who have deposited in consecutive months. I really need to be using the count of [PlayerId]s who have deposits in consecutive months.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.