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
DirkPuylaert
New Member

running total active Customers

Hello,

 

I'm trying to create a visual where I can see the total of Active sites based upon the selected date.

I have the following example table.

 

I don't just need a total, but a count of customers per month if they are between "siteActiveDate" and "siteInactiveDate"

If the "siteInactiveDate" is "-" it means the "end contractdate" is not known yet. 

 

Thanks in advance

 

customerID  customer                  siteActiveDate    siteInactiveDate

9705542Customer 11/01/20171/05/2017
9732311Customer 22/01/2017-
2075200Customer 33/01/2017-
9675600Customer 44/01/2017-
4037701Customer 55/01/2017-
40500Customer 66/01/2017-
5613800Customer 77/01/2017-
1888800Customer 88/01/2017-
9675398Customer 99/01/20171/09/2017
9675398Customer 1010/01/2017-
9675398Customer 1111/01/2017-
9705604Customer 1212/01/2017-
2075200Customer 1313/01/2017-
831701Customer 141/02/2017-
831701Customer 152/02/20171/10/2017
2075200Customer 163/02/2017-
2075200Customer 174/02/2017-
9657072Customer 100505/02/201712/02/2018

 

2 ACCEPTED SOLUTIONS
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @DirkPuylaert,

 

Please check out the demo in the attachment. 

1. Create a date table if you don't have one.

2. DO NOT establish any relationship. 

3. Create a measure.

 

Measure =
CALCULATE (
    COUNT ( Table1[customerID] ),
    FILTER (
        'Table1',
        'Table1'[siteActiveDate] <= SELECTEDVALUE ( 'Calendar'[Date] )
            && IF (
                ISBLANK ( 'Table1'[siteInactiveDate] ),
                DATE ( 9999, 12, 31 ),
                'Table1'[siteInactiveDate]
            )
                >= SELECTEDVALUE ( 'Calendar'[Date] )
    )
)

 

running_total_active_Customers

 

Best Regards,
Dale

Community Support Team _ Dale
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

Hi Dirk,

 

Please refer to the snapshot below.

running-total-active-Customers2

 

Best Regards,
Dale

Community Support Team _ Dale
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

3 REPLIES 3
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @DirkPuylaert,

 

Please check out the demo in the attachment. 

1. Create a date table if you don't have one.

2. DO NOT establish any relationship. 

3. Create a measure.

 

Measure =
CALCULATE (
    COUNT ( Table1[customerID] ),
    FILTER (
        'Table1',
        'Table1'[siteActiveDate] <= SELECTEDVALUE ( 'Calendar'[Date] )
            && IF (
                ISBLANK ( 'Table1'[siteInactiveDate] ),
                DATE ( 9999, 12, 31 ),
                'Table1'[siteInactiveDate]
            )
                >= SELECTEDVALUE ( 'Calendar'[Date] )
    )
)

 

running_total_active_Customers

 

Best Regards,
Dale

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

Hello Dale, 

 

That already works for some part, thanks a lot.

Now how can I have a visual like this?

 

Activesites.JPG

 

Thanks,

 

Dirk

 

Hi Dirk,

 

Please refer to the snapshot below.

running-total-active-Customers2

 

Best Regards,
Dale

Community Support Team _ Dale
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.