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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Active Customers by day

I currently count active and unactive customers based on customers who have been in +/- 100 days. My measures only give me a current day view of the active customers. Would it be possible to get a measure of active and unactive by day? Here is my set up:

date table

datekey

1/1/2021
1/2/2021

 

order table

order_datecustomer_idproductprice 
1/1/20211product a100.00 

 

customer table

customer_idcustomer nameLast order datedays since
1Joe1/1/2021today()-last order date
1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

I'm sorry. I modify the measure.

active = 
COUNTX (
    FILTER (
        ALL ( Customers ),
        Customers[CURRENT last order]
            >= SELECTEDVALUE ( 'Table'[Date] ) - 100
            && [CURRENT last order] <= SELECTEDVALUE ( 'Table'[Date] )
    ),
    [customerID]
) + 0
inactive = 
COUNTX (
    FILTER (
        ALL ( Customers ),
        Customers[CURRENT last order]
            < SELECTEDVALUE ( 'Table'[Date] ) - 100
            || [CURRENT last order] > SELECTEDVALUE ( 'Table'[Date] )
    ),
    [customerID]
) + 0

2.png

Best Regards

Janey Guo

 

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

16 REPLIES 16
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

I'm sorry. I modify the measure.

active = 
COUNTX (
    FILTER (
        ALL ( Customers ),
        Customers[CURRENT last order]
            >= SELECTEDVALUE ( 'Table'[Date] ) - 100
            && [CURRENT last order] <= SELECTEDVALUE ( 'Table'[Date] )
    ),
    [customerID]
) + 0
inactive = 
COUNTX (
    FILTER (
        ALL ( Customers ),
        Customers[CURRENT last order]
            < SELECTEDVALUE ( 'Table'[Date] ) - 100
            || [CURRENT last order] > SELECTEDVALUE ( 'Table'[Date] )
    ),
    [customerID]
) + 0

2.png

Best Regards

Janey Guo

 

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

v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

According to your last reply, You need to create a single date list as slicer and create two measure to calculate active and inactive.

Like this:

Table = DISTINCT('Date'[Date])
active = COUNTX(FILTER(ALL(Customers),DATEDIFF(SELECTEDVALUE('Table'[Date]),[CURRENT last order],DAY)<=100),[customerID])+0
inactive = COUNTX(FILTER(ALL(Customers),DATEDIFF(SELECTEDVALUE('Table'[Date]),[CURRENT last order],DAY)>100),[customerID])+0

 4.png

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

Anonymous
Not applicable

Doesn't look like that will work. If you zoom forward to today, there should be 1 active customer (made order on 3/1/21) and 4 inactive. 

htpbi_0-1617203466716.png

 

Hi, @Anonymous 

 

Did you download my file? Have you used new date column as slicer and use it in table instead of old?

 

Best Regards

Janey Guo

Anonymous
Not applicable

Yeah that picture was from your file. Zoom to today and there should only be one active

Anonymous
Not applicable

htpbi_0-1615996126487.png

 

Singaravelu_R
Resolver III
Resolver III

Add the calculated column in the customer table

Active or In active customer = if (DATEDIFF(today(),last order date())=100,  "Active Customer","Inactive Customer")

Anonymous
Not applicable

Don't think this would give me historical view of how many active and unactiave I have

Hi,  @Anonymous 

 

Can you explain the logic of active and inactive? Is it inactive if you don’t place an order on the same day?

Secondly, Can you share some more sample fake data? So we can quickly help you deal with the problem.

 

Best Regards

Janey Guo

 

Anonymous
Not applicable

Here is my current setup in PBI file and then I made a chart for what I am looking for. Active is if you placed an order in the last 100 days but I want to be able to see it historically instead of how I have it currently which is just off of today()

PBI File 

htpbi_0-1616162283609.png

 

Hi,  @Anonymous 

 

I'm sorry that monday is too busy, no time to reply. I see that your problem changes every time, it is difficult for me to understand what you are asking for.

I try to understand the requirements you described last time: Do you need to distinguish between active customers and inactive customers based on month and whether the date of the customer's last order is more than 100 days? Then I want to ask, there are different years in your date, how do you distinguish it? And if the user places an order in the current month, but the last order date has changed, shouldn’t it be counted in the current month?

Calculation is not difficult, but a complete logic is necessary before I can calculate. Can you explain more clearly?

 

Best Regards

Janey Guo

 

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

 

Anonymous
Not applicable

I would just want the formula using my datekey so I could pick and date in history and it do a 100 look back at active customers. For example if I put in 3/1/2021 it would just look at 3/1/2021 and minus 100 days to see who was active. It would ignore customer orders 3/2/2021 to today. 

Hi,  @Anonymous  

 

According to your description, You want to choose a date. If a customer has an order within 100 days of this date, then he is an active user, right?

But there is only month in this table, it will generate the question I replied last time, so what is the final result you want? How to achieve it is not difficult, as long as you are sure what you want.

v-janeyg-msft_0-1616638914525.png

Best Regards

Janey Guo

 

 

Anonymous
Not applicable

instead of month think of it as 1/31/2021, 2/28/2021, etc 

TomMartens
Super User
Super User

Hey @Anonymous ,

 

please describe your requirements in more detail and provide sample data that reflects your data model. Use the sample data to explain the expected result.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

The main thing I want is to make a table with all dates and a measure to show the active and unactive members at that time period. In this example I would say only have 200 total customers in this time period but every day 1 unactive customer came in so it moved them. Let me know if this helps explain better

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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