Forum Discussion
Sumx with date filter
Hello everyone
I need to know the first 3 days turnover pr. customer in order categorizes them later.
is it possible to create a column with this number?
Sample data below:
Kind regards
Alexander
Hi AlexanderAT ,
You can create columns like DAX below.
Rank = CALCULATE(COUNT(Table1[price]),FILTER(ALLSELECTED(Table1),Table1[Customer_Id]=EARLIER(Table1[Customer_Id])&&Table1[order_date]<=EARLIER(Table1[order_date])))
Top 3 days turnover= CALCULATE(SUM(Table1[price]),FILTER(ALLSELECTED(Table1),Table1[Customer_Id]=EARLIER(Table1[Customer_Id])&&Table1[Rank]<=3))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- v-xicaiCommunity Support
Hi AlexanderAT ,
You can create columns like DAX below.
Rank = CALCULATE(COUNT(Table1[price]),FILTER(ALLSELECTED(Table1),Table1[Customer_Id]=EARLIER(Table1[Customer_Id])&&Table1[order_date]<=EARLIER(Table1[order_date])))
Top 3 days turnover= CALCULATE(SUM(Table1[price]),FILTER(ALLSELECTED(Table1),Table1[Customer_Id]=EARLIER(Table1[Customer_Id])&&Table1[Rank]<=3))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AlexanderATHelper I
It works perfectly. Thanks