Forum Discussion
Calculate current month sales average
- Anonymous1 year ago
Hi HY2024 ,
I have tested Bibiano_Geraldo's measure. I think STARTOFMONTH() and DATEADD() could work with specific columns, it will return error if you use TODAY(). Here I suggest you to try EOMONTH()
Avg Sales Per Day Current Month = DIVIDE( CALCULATE( SUM('Table'[Sales]), DATESBETWEEN( 'Table'[Date], EOMONTH(TODAY(),-1)+1, TODAY() ) ), DATEDIFF( EOMONTH(TODAY(),-1)+1, TODAY(), DAY ) + 1, 0 )Avg Sales Per Day Same Period Last Year = DIVIDE( CALCULATE( SUM('Table'[Sales]), DATESBETWEEN( 'Table'[Date], EOMONTH(TODAY(),-13)+1, EOMONTH(TODAY(),-13)+ DAY(TODAY()) ) ), DATEDIFF( EOMONTH(TODAY(),-13)+1, EOMONTH(TODAY(),-13)+ DAY(TODAY()), DAY ) + 1, 0 )You can download my sample file to learn more details.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi HY2024 ,
I have tested Bibiano_Geraldo's measure. I think STARTOFMONTH() and DATEADD() could work with specific columns, it will return error if you use TODAY(). Here I suggest you to try EOMONTH()
Avg Sales Per Day Current Month =
DIVIDE(
CALCULATE(
SUM('Table'[Sales]),
DATESBETWEEN(
'Table'[Date],
EOMONTH(TODAY(),-1)+1,
TODAY()
)
),
DATEDIFF(
EOMONTH(TODAY(),-1)+1,
TODAY(),
DAY
) + 1,
0
)Avg Sales Per Day Same Period Last Year =
DIVIDE(
CALCULATE(
SUM('Table'[Sales]),
DATESBETWEEN(
'Table'[Date],
EOMONTH(TODAY(),-13)+1,
EOMONTH(TODAY(),-13)+ DAY(TODAY())
)
),
DATEDIFF(
EOMONTH(TODAY(),-13)+1,
EOMONTH(TODAY(),-13)+ DAY(TODAY()),
DAY
) + 1,
0
)
You can download my sample file to learn more details.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.