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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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