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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
k_microsoft_acc
New Member

Power Bi - Count of subscriber with variable start/end dates per quarter?

Hello-

I have a list where each row is an individual subscription record. The subscribers can have variable start and end dates, but I would like to show how many subscribers are "active" at the end of each quarter. Users

 

My data looks like this: (null end date means the subscription is still going)

UserIDStartDateEndDate
17/1/202211/3/2022
27/1/20222/1/2023
310/5/2020null
41/1/2020null
12/2/2023null

 

 

I'd like to create a table similar to:

 Total_Subscribers
Q1 (7/1/22-9/30/22)4
Q2 (10/1/22-12/31/22)3
Q3 (1/1/23-3/30/23)3
Q4 (4/1/23 - 6/30/23)3

 

Can anyone help me to accomplish this? 

2 REPLIES 2
ThxAlot
Super User
Super User

SUBSCRIPTON.pbix

 

ThxAlot_0-1692430728641.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



jdbuchanan71
Super User
Super User

@k_microsoft_acc 

You will need a Dates tables that is not connected to your Subscriptions table which you can make with this DAX.

Dates = 
ADDCOLUMNS(
    CALENDARAUTO(),
    "Year",YEAR([Date]),
    "Quarter","Q" & QUARTER([Date]),
    "Year Quarter", YEAR([Date])&"-Q"&QUARTER([Date])
)

Then a measure to calculate the unique Subscriptions[UserID] on the last day of the period you are looking at.

Ending Subscribers = 
VAR _End = MAX ( Dates[Date] )
RETURN
CALCULATE (
    DISTINCTCOUNT ( Subscriptions[UserID] ),
    Subscriptions[StartDate] <= _End,
    ( Subscriptions[EndDate] >= _End || ISBLANK ( Subscriptions[EndDate] ) )
)

Then you add the Year Quarter field from the Dates table and the measure to your visual.

jdbuchanan71_0-1692389187941.png

I have added my sample file for you to look at.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.