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
madmanmark198
Frequent Visitor

Best way to create a recency segment

Hi there

 

I have a table with all of my customer donations listed.  Basically many rows of transactions for each customer.  Columns are:

 

  • Transaction ID
  • Date
  • Amount
  • Customer ID

 

I would like to create a segment around recency of payment but I wasnt sure how best to do this  Whether create a column in the data or new table or just a calculated measure.

 

The segment I want to create is basically called "Actives".  I want to effectivly be able to group Active customers in an easy way.  Below is the criteria for this:

 

Anyone who has made a payment in the LAST 12 months + made at least 1 payment prior to the last 12 months.

 

Please help?

 

Many thanks

 

Mark

1 REPLY 1
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @madmanmark198  - I would use the measure something along the lines of the following rather that than adding calculated column.  Note this is a guess and untested because I don't have your data model.

Count Customers = 
   COUNTA ( Customer[CustomerID] ) 

Count of Active Customers = 
   VAR _Date = TODAY - 365
   VAR _Customers = 
        SUMMARIZE ( 
           Customer ,
           CustomerID , 
           "Is Active" , CALCULATE ( COUNTA[Transaction[Transaction ID] ),
                             FILTER ( Calendar , Calendar[Date] >=  _Date ) )
        )
   VAR _Filter = FILTER ( _Customers , [Is Active] > 0 )
   VAR _Result = COUNTROWS ( _Filter )
RETURN
   _Result

  

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.