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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Tvineyy
New Member

Calculate growth over time based on User opt-in date and opt-out date

Hi All,

 

I am looking to create a line chart to show the cumulative growth in some email audience data (600K + rows). In the table below there is an example of the data with opt-in date (when user joined the email list) and sometimes the opt-out date (If the value is NULL then they are still opted in).

 

How can I create a line chart that shows cumulative growth in email audience but takes into account when each user opted out?

 

I also need to keep the User ID column to join with fact tables.

 

User IDOpt in DateOut-out Date
10101-01-202001-12-2020
10202-01-202102-02-2021
10303-01-2022NULL

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Tvineyy ,

 

Please create a date table:

 

vkkfmsft_0-1647568739662.png

 

Then create the measure:

 

Measure = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[User ID] ),
    FILTER (
        'Table',
        'Table'[Opt in Date] <= MAX ( 'Calendar'[Date] )
            && (
                'Table'[Out-out Date] >= MIN ( 'Calendar'[Date] )
                    || ISBLANK ( 'Table'[Out-out Date] )
            )
    )
)

vkkfmsft_1-1647568789639.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Tvineyy ,

 

Please create a date table:

 

vkkfmsft_0-1647568739662.png

 

Then create the measure:

 

Measure = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[User ID] ),
    FILTER (
        'Table',
        'Table'[Opt in Date] <= MAX ( 'Calendar'[Date] )
            && (
                'Table'[Out-out Date] >= MIN ( 'Calendar'[Date] )
                    || ISBLANK ( 'Table'[Out-out Date] )
            )
    )
)

vkkfmsft_1-1647568789639.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

amitchandak
Super User
Super User

@Tvineyy , check it it very similar to active employee

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.