Forum Discussion
Anonymous
6 years agoNot applicable
Total Sales for partial year
Hi, I have a measure "TotalSalesYTD" TotalSalesYTD = CALCULATE ( Sum(Order[Sales]), FILTER ( ALL ( 'Calendar' ), 'Calendar'[Year] = MAX ( 'Calendar'[Year] ) && 'Calendar'[Month] = MAX ( 'Calen...
- Anonymous6 years ago
Hi,
Thanks you all for your prompt responces
I was able to achieve this by using the below DAX
TotalSalesIncludingPartialYear=
Var MaxMonth = MONTH(LASTDATE(Orders[OrderDate]))
RETURN
CALCULATE([TotalSales], 'Calendar'[Month]=MaxMonth)Thank you all
Anonymous
6 years agoNot applicable
Hi Anonymous ,
According to my understanding, you want to calculate the sum of sales ahead of current year date, right?
Here is my data sample, then use the following formula:
Filtered table =
FILTER ( 'Order', 'Order'[Date] < NOW () )Order year =
YEAR ( 'Filtered table'[Date] )TotalPerYear =
CALCULATE (
SUM ( 'Filtered table'[Sales] ),
ALLEXCEPT ( 'Filtered table', 'Filtered table'[Order year] )
)
My visualizations look like this:
Is the result what you want? If not, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin