Forum Discussion
Noelle
Helper I
4 years agoCalculate average distinctcount with variable duration in the last 12 months
Hi all,
I would like to calculate the amount of rows in a table listing orders (that will be "orders amount") , on a specific duration that is depending on "account name".
I've tried using the following :
orders amount depending on duration = CALCULATE(DISTINCTCOUNT(sales[order number], DATESINPERIOD('DATE'[Date], 'DATE'[Today], -MAX('sales'[payment terms in day]', day))
But the calculation is done on last periode (for example last 30 days), and it would be more accurate if I could calculate the average "order amounts/duration" on last 12 months.
Any idea? I'm stuck here ๐
Thank you in advance for your help.
Noelle
6 Replies
- johnt75
Super User
orders amount depending on duration = CALCULATE(DISTINCTCOUNT(sales[order number], DATESBETWEEN( 'Date'[Date], DATE( YEAR(TODAY()) - 1, MONTH(TODAY()), DAY(TODAY()), TODAY()) )