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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
ciken
Resolver I
Resolver I

Count active subscriptions in variable timeframe

Hi PBI community,

 

I am working hard to count active subscriptions based on the product purchased in a given time frame. 

EXAMPLE: Greg Smith buys Product A and Product B on subscription, I am wanting to count him as 2 active subscriptions...but when I use the current measure with COUNTA, it counts EVERY order within my time frame, but, if I switch it to DISTINCTCOUNT, it will only count the product one time for everyone.  It almost needs to be two different measures but I was trying to see if it could be done in one.  

Here is my current measure - I'd love any suggestions...and if it is to create a separate one based on product vs consumer, let me know that too.

 

Thanks

Corey

 

Active AR Subscriptions =
CALCULATE(COUNTA('Line Items'[OrderedProductSKU]),DATESINPERIOD(CalendarTable[Dates], LASTDATE(CalendarTable[Dates]),-'Retention By Day'[Retention By Day Value],DAY))
1 REPLY 1
Anonymous
Not applicable

Hi @ciken ,

 

According to your code, I find there are three tables 'Line Items'/'CalendarTable'/'Retention By Day'. I think 'Line Items' should be the fact table. 'CalendarTable' and 'Retention By Day' should be dimtables which should have relationships with 'Line Items'. If your relationship looks like as I mentioned, I suggest you to set the direction of these relationships from single to both. Then have a try.

If this reply still couldn't help you solve your issue, please share a sample file with me and show me with a screenshot with the result you want. I need to know your data model. This will make it easier for me to find the solution.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.