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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.