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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Krijgersss
Helper II
Helper II

need help with dax based on dates

hello i need some help. i have a colum with order-dates now i need a formule that shows me if someone placed a order for the first time its a "new costumer" if the customer placed a second order then they will be a "KNow customer"

so i need a formule based on my "Order-dates" how many New customers there are. in the screenshot you will see my data model

Krijgersss_0-1724754338496.png

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Krijgersss , Create a Calculated Column to Identify the First Order Date for Each Customer:

FirstOrderDate =
CALCULATE(
MIN('Orders'[OrderDate]),
ALLEXCEPT('Orders', 'Orders'[CustomerID])
)

 

Create a Calculated Column to Determine if the Order is the First Order:

IsFirstOrder =
IF(
'Orders'[OrderDate] = 'Orders'[FirstOrderDate],
"New Customer",
"Known Customer"
)

 

Create a Measure to Count the Number of New Customers:

NewCustomerCount =
CALCULATE(
DISTINCTCOUNT('Orders'[CustomerID]),
'Orders'[IsFirstOrder] = "New Customer"
)

 

Create a Measure to Count the Number of Known Customers:

KnownCustomerCount =
CALCULATE(
DISTINCTCOUNT('Orders'[CustomerID]),
'Orders'[IsFirstOrder] = "Known Customer"
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@Krijgersss , Create a Calculated Column to Identify the First Order Date for Each Customer:

FirstOrderDate =
CALCULATE(
MIN('Orders'[OrderDate]),
ALLEXCEPT('Orders', 'Orders'[CustomerID])
)

 

Create a Calculated Column to Determine if the Order is the First Order:

IsFirstOrder =
IF(
'Orders'[OrderDate] = 'Orders'[FirstOrderDate],
"New Customer",
"Known Customer"
)

 

Create a Measure to Count the Number of New Customers:

NewCustomerCount =
CALCULATE(
DISTINCTCOUNT('Orders'[CustomerID]),
'Orders'[IsFirstOrder] = "New Customer"
)

 

Create a Measure to Count the Number of Known Customers:

KnownCustomerCount =
CALCULATE(
DISTINCTCOUNT('Orders'[CustomerID]),
'Orders'[IsFirstOrder] = "Known Customer"
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.

Users online (4,015)