Forum Discussion
Average count per month
I have a date table.
We have our orders that come in daily, although some days no orders come in. I need to determine the average number of orders per month. Using order ID.
so a simple example below. If the first 4 days of a month had these counts of distinct orders, determine the average number of orders that month. So the measure should count days with no orders. In this example the month average would be 4.25.
5
0
8
4
Hi , Anonymous
If no orders come in on a certain day of a month and that day will still be counted,you can try measure as below:
Measure2 = var countRow=CALCULATE(COUNT('Table'[Day of month]),ALL('Table')) var days=DAY(EOMONTH(SELECTEDVALUE('Table'[Date]),0)) return DIVIDE(countRow,days)Best Regards,
Community Support Team _ Eason
4 Replies
- FowmySuper User
Anonymous
Simple Average will do as, by default, Average function will not consider blank, but if you want to avoid zero then
UseMeasure = CALCULATE( AVERAGE('Table'[Column1]), 'Table'[Column1]>0)________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
- AnonymousNot applicable
Hi Fowmy I am counting text strings, not values. So this does not seem to work.
For example: First 4 days of the month. 4 distinct orders (two on the 1st day of the month). So, 5 orders in 4 days. Average orders per day. 1.25
Day of Month Order ID
1 1234
1 1237
2 3490
3 3456
4 3457
- FowmySuper User
- v-easonf-msftCommunity Support
Hi , Anonymous
If no orders come in on a certain day of a month and that day will still be counted,you can try measure as below:
Measure2 = var countRow=CALCULATE(COUNT('Table'[Day of month]),ALL('Table')) var days=DAY(EOMONTH(SELECTEDVALUE('Table'[Date]),0)) return DIVIDE(countRow,days)Best Regards,
Community Support Team _ Eason