Forum Discussion
Anonymous
7 years agoNot applicable
How to shift date axis using what-if parameter?
I have two timeseries that are connected by a DimDate table that I am plotting on a dual-axis line chart. I would like to be able to use a What-If slicer to shift one time series by N months, thereb...
- 7 years ago
Anonymous
Here is my edited version of your PBIX.
link- First I created a parameter table DateOffset using Modelling => New Parameter.
- Added a slicer for this parameter as in your screenshot
- I also marked your DimDate table as a date table. This is best to do when you are using time intelligence functions.
- I created measures called Primary & Indicator, just for the sake of consistency with your earlier screenshot.
Indicator uses DATEADD to shift the date filter by the negative of the DateOffset value selected. This gives the appearance of shifting Indicator to the right if a positive DateOffset is selected.
Primary = AVERAGE ( 'Value by Date 1'[Value] ) Indicator = CALCULATE ( AVERAGE ( 'Value by Date 2'[Value] ), DATEADD ( DimDate[Date], -[DateOffset Value], MONTH ) )Regards,
Owen
Anonymous
5 years agoNot applicable
Love that solution, would be great to see a reupload of your file (or from anyone else if OP doesn't respond)!
OwenAuger
5 years agoSuper User
Anonymous
Just fixed the link in m post above 🙂
Thanks for pointing that out, as I will have to go back fix a bunch of others due to a change in my username.