Forum Discussion
Product trend analysis
Hi Anonymous ,
Now i have to save the monthly SWAP rates based on the launch date and should be able to show the SWAP rate values as below .
X - Axis : The SWAP rates for the products for first month , first 2 months , first 3 months .... first n months for the products .
Y Axis : SWAP rate percentage which I already have .
As already mentioned I have the launchdates of each product as well . Can you suggest how can I achieve the X - axis now ?
Thanks in advance .
Since we have a SWAP formula that can calculate any date range, you would just need to use the Date Table's Month/Year values on the X axis. You could use a measure like this to calculate the SWAP value to date. The X Axis will ensure you are getting each month
Swap Rate To Date = var metricDate = LASTDATE('Dates'[Date])
var result = CALCULATE(
[SWAP],
ALL('Dates'),
'Dates'[Date] <= metricDate
)
RETURN
result
If you want a variable start date, you'll need to add a little bit more to the code.