Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all ,
I have to show product SWAP rate analysis based on the launch date per each product .
Need to show the total SWAP happened for each product for last n months (4 months , 8 months , 12 months) . In this case the launch month per each product is different(dynamic) but I need to show the first 4 months (or 8 months / 12 months ) SWAP trends for the last n months for all the products using a line graph .
Please help on how to do it using calculated columns , I have SWAp rates for the products and launch month per each product .
Thanks .
I don't think you need calculated columns. If you have a product table, hopefully you can a column already in your data with the launch date.
Next you need some measures that will calculate what you need, which can do the time related math based on that date. The measure would be designed to be used in a context where you are displaying information related to products, i.e. a table with each product listed, or a graph with 1 row per product.
Here is a quick example that assumes:
Swap Rate 4 Months= var launchDate = FIRSTDATE('Product'[LaunchDate])
var result = CALCULATE(
[SWAP],
ALL('Dates'),
DATESINPERIOD('Dates'[Date], launchDate, 4, MONTH)
)
RETURN
result
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.
Thanks a lot for the response @Anonymous . I will try to implement the SWAP Rate for 4months as suggested by you and get back for any clarifications .
Thanks
Neeharika.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 7 | |
| 6 |