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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Number of new Customer and Number of inactive Customers

I'm begginner in dax, and I can't figure out how to solve this : 

 

My dataset is : 

- OrderDate

- CustomerID

 

Number of new customer = Customer which first order is lower than 30 days versus today()

Number of inactive customer = Customer which last order is higher than 30 days versus today()

 

Any idea ?

Thanks,

C.

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@Anonymous 
Create the following measures: 

Number of new customer  = CALCULATE(COUNT('Table'[ID]),FILTER(ALL('Table'),DATEDIFF([OrderDate],TODAY(),DAY)<30))

Number of inactive customer = CALCULATE(COUNT('Table'[ID]),FILTER(ALL('Table'),DATEDIFF([OrderDate],TODAY(),DAY)>30))

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you for your answer,

 

Unfortunatelly your calculation for new customer take all customers, I need to retrive the first sales > than 30 days. Not the last sale even if the customer odered before the last 30 days. Same for inactive.

 

Regards. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.