Forum Discussion
Help with dates between two rows
craigdent , Try like
measure =
var _Mtd = CALCULATE(Max(Table[Date]),DATESMTD('Date'[Date]))
var _lmt = CALCULATE(Max(Table[Date]),DATESMTD(dateadd('Date'[Date],-1,MONTH))) +1
return
calculate([measure], filter (all('Date') , 'Date'[Date]>= _lmt && 'Date'[Date]<=_Mtd))
Thanks amitchandak,
I couldn't get this working either, I think because it assumes the next monthly cut off is the same day of the next month, however it varies depending on the lenght of the month and the next pay day (which could be earlier if it would fall on a weekend or bank holiday).
Also, the [measure] on the last line kept coming up with a circular error warning, should I ignore that?
- amitchandak5 years agoSuper User
craigdent ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.