Forum Discussion
Total monthly sales
- Anonymous4 years ago
Hi Syndicate_Admin ,
I created some data:
Here are the steps you can follow:
1. Create calculated column.
Year = YEAR('Table'[Date])Month = MONTH('Table'[Date])2. Create measure.
total amount of sales made in each month = CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])&&'Table'[Month]=MAX('Table'[Month])))If you want to get the amount of all dates in the entire table, you can use the following function:
sales generated in those three months = SUMX(ALL('Table'),[Amount])If you want to get the total for a given three months:
You can use [Month] as a slicer to specify which three consecutive months.
Slicer_amount = var _min=MINX(ALLSELECTED('Table'),[Month]) var _max=MAXX(ALLSELECTED('Table'),[Month]) return CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Month]>=_min&&'Table'[Month]<=_max))Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Syndicate_Admin ,
I created some data:
Here are the steps you can follow:
1. Create calculated column.
Year = YEAR('Table'[Date])Month = MONTH('Table'[Date])
2. Create measure.
total amount of sales made in each month =
CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])&&'Table'[Month]=MAX('Table'[Month])))
If you want to get the amount of all dates in the entire table, you can use the following function:
sales generated in those three months =
SUMX(ALL('Table'),[Amount])
If you want to get the total for a given three months:
You can use [Month] as a slicer to specify which three consecutive months.
Slicer_amount =
var _min=MINX(ALLSELECTED('Table'),[Month])
var _max=MAXX(ALLSELECTED('Table'),[Month])
return
CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Month]>=_min&&'Table'[Month]<=_max))
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly