martingaleh
Board Regular
- Joined
- Jul 18, 2011
- Messages
- 83
I have months in columns from a table called dates_d.
I want the revenue of the prior month, so I did
calculate([rev],filter(all(dates_d),dates_d[date]>=edate(mina(dates_d),-1)&&dates_d[date]<edate(mina(dates_d),0)))
Which works fine
But then I do
calculate([rev],filter(all(dates_d),dates_d[date]>=eomonth(mina(dates_d),-2)&&dates_d[date]<eomonth(mina(dates_d),-1)))
and it selects all the revenue as if there isn't a filter. It's almost as if the edate is keeping the dates_d filter context and eomonth is not before calculating the minimum date with which to get the beginning and end of the prior month.
But then, when I just show the eomonth calculation, it's for the right date.
I want the revenue of the prior month, so I did
calculate([rev],filter(all(dates_d),dates_d[date]>=edate(mina(dates_d),-1)&&dates_d[date]<edate(mina(dates_d),0)))
Which works fine
But then I do
calculate([rev],filter(all(dates_d),dates_d[date]>=eomonth(mina(dates_d),-2)&&dates_d[date]<eomonth(mina(dates_d),-1)))
and it selects all the revenue as if there isn't a filter. It's almost as if the edate is keeping the dates_d filter context and eomonth is not before calculating the minimum date with which to get the beginning and end of the prior month.
But then, when I just show the eomonth calculation, it's for the right date.