Have different styles of the same data field in the same plot

Hi,

I have a plot that is showing historic data and my own forecasts. I have all my forecasts and the the historic data in the same data column and a date column that spans the future and the past. However, when I plot them then obviously I see only one line that shows all the data, but I want to distinguish on the line which are the historic data and which are the future predictions. Preferably by just making the forecasted part dashed, but I am open for other solutions. Appreciate any help I can get!

Hello @martiniukas - Thank you for posting your query. I believe you can split your single measure column into two calculated fields - historical and forecasted based on a date comparison criteria and then project both these metrics in the line chart. You can format the Forecasted Line to have it appear in dashed format. Sharing some snippets of the sample implementation that tried from my end. Please feel free to alter the expression according to your need as my sample data is not the same like you. Hope this helps!

Sample Measures

image

image

Sample Line Chart

Did my suggestion help you in resolving your query? If yes, would request you to mark the post as “Solution”. This will help the community to find guidance and answers to similar question. Thank you!

Hi @sagmukhe, thank you for your response. This is a really good idea but there are two concerns with this solution for me.

  1. The forecast is done once a month so I would like to have the cut-off date to be automatically adjusted that the forecast showed starts from the first day of the current month. Is that possible?

  2. This solution doesn’t let me add any fields to the “Color” field list which I would like to do to split the forecast between different product segments

Thanks @martiniukas for your response and follow-ups. Please find my responses below.

  1. I believe you can use the combination of now() and trunc() function to dynamically determine first day of the current month and use that in the comparison to segregate historical and forecasted data. Something Like :
    truncDate(“MM”, now())

  2. I believe there are 2 ways to overcome this. Either you leverage the “small multiples” in the field wells to have them divided. Or if you have a small number of finite product segments then you can try to create calculated fields for each one of them. For example - Product Segment A Historical Sales, Product Segment A Forecasted Sales, Product Segment B Historical Sales, Product Segment B Forecasted Sales etc. so on and so forth. Definitely not elegant and quite cumbersome. But that’s what I can think of at this point of time. But I hope this helps!

Did my suggestion help you in resolving your query? If yes, would request you to mark the post as “Solution”. This will help the community to find guidance and answers to similar question. Thank you!