Forum Discussion
Line stype in the graph
Zakaria_1980 , you need the red bar the green dotted line. Not very clear to me
the red bar is shifted automatically from week to another based on the actual figures that i got. in the grapg i've shared with you, i got the actuals for W33 which means the red bar is plot automatically in the that week.
what i've asked is only on thu curve in green. in the graph i've sent i made the type of the line in dash. the team want that curve the type of the line should be solid before the red bar and then the type will change in dotted line after the red bar.
- Pragati116 years ago
Super User
HI Zakaria_1980 ,
I don't think this is possible to achieve as you want same metric to be shown as solid line before the bar and dotted line after the same bar.
Happy to know if someone in the community can tell a workaround for this.
Thanks,
Pragati
- AllisonKennedy6 years ago
Community Champion
Zakaria_1980
That picture you drew is exactly what I had in mind after your first post, just need to know what your raw data model looks like and what are you currently using for the values of the green and red lines? Is the red line a MEASURE? is the green line a column or measure?
To make the line change style, you will need to split the line into two MEASURES - so first calculate the green line for everything BEFORE week 33. Make this solid. Then calculate the green line for everything AFTER week 33. Make this dotted.
Does that make sense? Let us know how you get on and if you need more info we will need your specific table and column names and their relationships.
It can change colour at the red line using conditional formatting. - PaulDBrown6 years ago
Community Champion
As a "quick and dirty" alternative to the solutions offered, you can use conditional formatting on a line chart (well, kind of...There isn't an option to apply conditional formatting in a line chart as a default option).
However...
Start with a bar chart, and apply the conditional formatting (in this example, I've simply coloured the data points after july 2019 in the reddish colour, using a simple measure to set a rule in the conditional formatting interface):
After 31 july 219 = IF(MAX('Calendar Table'[Date])> DATE(2019, 07, 31), 1)Once you have set the conditional colour on the bar chart, select the visual and change it by clicking on the line chart visual in the visuals pane, to get you something like this (not ideal, I know, but "quick and dirty"...)
However, that is about it as to the formatting options you get using this method.
If you need flexiblility, I would follow AllisonKennedy suggestion.