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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sini
Regular Visitor

New and repeat customer with rules in PBI

I would like to create visualization for new and repeat customer based on these rules

 

We have customer group and customer. For example,

Customer groupCustomerOrder date
Ax1/1/2024
Ay1/2/2024
Bz1/1/2024

 

New customers = customers or customer groups that haven't ordered in the past

Repeat customers = customers or customer groups that ordered again

 

From the example table,

January 2024

New customers = 2 (A-x and B-z)

Repeat customers = 0

 

February 2024

New customers = 0

Repeat customers = 1 (A-y)

 

Could you kindly guide dax to fullfil the above rules? 🙂

4 REPLIES 4
Anonymous
Not applicable

Hi @sini ,

 

I created a sample file, hope that helps:

vcgaomsft_1-1733205637106.png

Output:

vcgaomsft_0-1733205618373.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Wow, this works perfectly.

 

Can I add more condition for the customer hierarchy?

 

There're customers without customer group.

Customer groupCustomerOrder date
 m1/1/2024
 n1/1/2024
 m1/2/2024

 

From the example table,

January 2024

New customers = 2 (m and n)

Repeat customers = 0

 

February 2024

New customers = 0

Repeat customers = 1 (m)

 

Could you kindly add this rule to the measures?😊

powerbidev123
Solution Sage
Solution Sage

Hi @sini ,

 

Try these

 

NewCustomers =
CALCULATE(
    DISTINCTCOUNT('Table (3)'[Customer]),
    FILTER(
        'Table (3)',
        FORMAT('Table (3)'[Order Date], "YYYY-MM") = FORMAT(MINX(FILTER('Table (3)','Table (3)'[Customer]= EARLIER('Table (3)'[Customer])), 'Table (3)'[Order Date]), "YYYY-MM")
    )
)
 
 
RepeatCustomers =
CALCULATE(
    DISTINCTCOUNT('Table (3)'[Customer]),
    FILTER(
        'Table (3)',
        FORMAT('Table (3)'[Order Date], "YYYY-MM") >
        FORMAT(MINX(FILTER('Table (3)', 'Table (3)'[Customer] = EARLIER('Table (3)'[Customer])), 'Table (3)'[Order Date]), "YYYY-MM")
    )
)

Hi,

 

Thank you for the measures, but they didn't consider the group level of the customer?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.