Forum Discussion
Units for prior dates
- 8 years ago
Hi,
Create a Calendar Table with a relationship from the Date column of the Sales table to the Date column of the Calendar Table. Try these measures:
Units sold in final month = CALCULATE(SUM('Sales'[Units]),DATESBETWEEN(Calendar[Date],EOMONTH(MAX(Calendar[Date]),-1)+1,EOMONTH(MAX(Calendar[Date]),0))))
Units sold in month before final month = CALCULATE(SUM('Sales'[Units]),DATESBETWEEN(Calendar[Date],EOMONTH(MAX(Calendar[Date]),-2)+1,EOMONTH(MAX(Calendar[Date]),-1))))
Hi,
Create a Calendar Table with a relationship from the Date column of the Sales table to the Date column of the Calendar Table. Try these measures:
Units sold in final month = CALCULATE(SUM('Sales'[Units]),DATESBETWEEN(Calendar[Date],EOMONTH(MAX(Calendar[Date]),-1)+1,EOMONTH(MAX(Calendar[Date]),0))))
Units sold in month before final month = CALCULATE(SUM('Sales'[Units]),DATESBETWEEN(Calendar[Date],EOMONTH(MAX(Calendar[Date]),-2)+1,EOMONTH(MAX(Calendar[Date]),-1))))
Thank you, Ashish_Mathur! That is exactly what I was looking for and I very much appreciate your help!
- Ashish_Mathur8 years agoSuper User
You are welcome.