Forum Discussion
pxg08680
8 years agoResolver III
Data Calculation
Hi Everyone, hope someone helps me with this. I have few columns like Date, Currency, SPVar, SHVar, Xvar, X_LVar. All the variances are in percentages. So what I need is, I want to cal...
pxg08680
8 years agoResolver III
parry2k wrote:pxg08680 define last two months, last 60 days from exchange date, or if exchange date is in Jan 2018, last two months are Nov/Dec 2017?
***ExchangeRateDate > DATEADD(Month,-2,(select max(ExchangeRateDate)from [dbo].[vw_ConsumerFXVar])**
This is what I was using to validate my data back in SQL. The abouve where query gives me all the dates from Today to begining of Nov.
In the same way Last 4 Months would be from today to begining of September.
parry2k
8 years agoSuper User
SPVar Crossed Limit in Last 2 Months =
var dt = MAX(Sheet1[ExchangeRateDate]) - 1
var lastNumberofDays = 2
return
Calculate(CountRows(Sheet1),
Filter(ALLEXCEPT(Sheet1, Sheet1[CurrencyCode]),
(Sheet1[SurfaceProvariance] >= 0.05 || Sheet1[SurfaceProvariance] <= -0.05)
),
DATESINPERIOD(Sheet1[ExchangeRateDate], dt, -lastNumberofDays, month)
)make highlighted changes and that will do it.