Forum Discussion
Last Month Calculations not functioning
- 5 years ago
Hi dbrandone ,
Please check the relationship between your calendar table and vsales table. It should be one to many active relationship.
You can also use the following measure:
Items sold Last Month = VAR vToday = TODAY () VAR vEndDate = EOMONTH ( vToday, -1 ) VAR vResult = CALCULATE( COUNT(vSales[ItemSold]), DATESINPERIOD('Calendar'[Date], vStartDate, 1,MONTH) ) Return vResultIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi mwegener ,
Yeah, I noticed that. I tried both 'Calendar[Date]' and 'Calendar[Date].[Date]' and both are having issues. I was trying anything I could at that point. I think I tried the .[Date] at the end since intellisense was offering it. I checked and it is marked as the date table.
Hi dbrandone ,
Please check the relationship between your calendar table and vsales table. It should be one to many active relationship.
You can also use the following measure:
Items sold Last Month =
VAR vToday =
TODAY ()
VAR vEndDate =
EOMONTH ( vToday, -1 )
VAR vResult =
CALCULATE(
COUNT(vSales[ItemSold]),
DATESINPERIOD('Calendar'[Date], vStartDate, 1,MONTH)
)
Return
vResult
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai