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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Chanleakna123
Post Prodigy
Post Prodigy

how to count customer Active or Not Active based on the date filter ?

Hi all , 

My purpose is to see which Customers Active and Customers who are not Active based on the date filter. i have below report table , If the customer who is last 3 months Purchased , we count Active customers , If Not purchased for the last 3 months , they are In-Active Customers . I will also need to filter by date 

1.JPG

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

Hi @Chanleakna123,

 

To create a measure as below.

Measure = 
VAR today =
    TODAY ()
VAR e3 =
    EDATE ( today, -3 )
VAR qty =
    CALCULATE (
        SUM ( 'Table'[qty] ),
        FILTER ( 'Table', 'Table'[Date] <= today && 'Table'[Date] >= e3 )
    )
RETURN
    IF ( qty > 0, "Active >=1", "Not Active <1" )

Capture.PNG

 

For more details, please check the pbix as attached.

 

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

View solution in original post

6 REPLIES 6
v-frfei-msft
Community Support
Community Support

Hi @Chanleakna123,

 

To create a measure as below.

Measure = 
VAR today =
    TODAY ()
VAR e3 =
    EDATE ( today, -3 )
VAR qty =
    CALCULATE (
        SUM ( 'Table'[qty] ),
        FILTER ( 'Table', 'Table'[Date] <= today && 'Table'[Date] >= e3 )
    )
RETURN
    IF ( qty > 0, "Active >=1", "Not Active <1" )

Capture.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
amitchandak
Super User
Super User

Try something like this

Active or Not =
var _Rolling_3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],ENDOFMONTH(Sales[Sales Date]),-3,MONTH))  
return
if(isblank(_Rolling_3),"Not Active","Active")

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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

Hi @amitchandak  can I know what do you means by (Date[Date Filter]) where this field located ? Is it in sales order or in Customer table? Please explain

 

hi @amitchandak , i have acheived your result by using the Dax with Measure . 

but now i'd like to go another step , how can i count customers who are "Active" or "Inactive" ? 
and how can i create slicer over these measure? 

countx, should work.

 

Active = countx(filter(sales,[Active or Not]="Active"),cutomer_id)

 

If not. If possible please share a sample pbix file after removing sensitive information.Thanks.

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

 

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
TomMartens
Super User
Super User

Hey @Chanleakna123 ,

 

please prepare a pbix that contains sample data but still represents your data model, upload the pbix to onedrive or dropbox and share the link. If you use an Excel file to prepare the sample data, upload the xlsx as well.

 

Please elaborate a little more on "I will also need to filter by date"

Please explain what "Active >= 1" means, and the expected possible values this flag can hold, of course this is also valid for the Non-Active flags.

 

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

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.