Tikhon
Tikhon

Reputation: 451

Slicer driving a dynamic line chart in Power BI

Looking to make a sub-section of a line chart move dynamically using a slicer in power BI. I want to show the market implied interest rate overlaid on the actual interest rate at different points in time.

I have a panel of data with historical interest rates at end of month and the market expectations for the rate X number of months in the future. For every month I have 29 observations: The current rate and 28 expected rates 28 months in the future.

What I want is for the slicer to move the expected line, along the actual line as shown below. That is the blue line should be fixed and every slicer position should generate a new red line. For instance: the below chart would result from a slicer position: May 2015.

In this case the slicer would have been set to May 2015

This is a broad question because I am asking struggling with the structure I should implement rather than specific code. I am very much a beginner with using Power BI.

Thank you in advance.

Upvotes: 0

Views: 822

Answers (1)

OscarLar
OscarLar

Reputation: 1335

It sounds like you're looking for a What-if parameter. This is available on the modelling page of the dash board view.

If you have a month offset column in your calendar you can create a what-if parameter ranging from -x to 0 (or what you need) and then write the measure for the red line using the selected value from the what if as start for the interval for the red line. In my case I use month offset and then set the prognosis interval to the parameter value + 3 months, like this: enter image description here

enter image description here

Uppdate 1:

So I was playing around this weekend and I made a model to illustrate my point. So here are a few images where the green line is a made up fund and the black is a "prognosis" (in this case, random numbers). However, for each parameter value there is a different prognosis:

enter image description here enter image description here enter image description here enter image description here

And just to show that there are more than one prognoses, here are the four in the same frame

enter image description here

Upvotes: 0

Related Questions