Forum Discussion
How to differentiate past data and future data on a line chart
Hi All,
I would like to create line charts with dates on the X-axis and values on the Y-axis.
I should differentiate the future data and past data (e.g. when the values belong to a future date, I should use dotted lines).
Do you have any kind of solution for this case?
Thank you.
Tibor
TiborTuboly I guess you can achieve this by using couple of measures. Add following measures and put date on x-axis and these two measures on Y - Axis.
Amount = IF( MAX( Table1[Date] ) <= TODAY(), SUM( Table1[Amount] ) ) Amount Future = IF( MAX( Table1[Date] ) >= TODAY(), SUM( Table1[Amount] ) )
To show dotted line for future, go to format tab and under shapes, turn on customize series, and select "Amount Future" and change it to dashed.
This is how output will look like
Hi TiborTuboly,
I created an example where basically in the modeling area I created a formula to check if the date is past or future:DataType = IF (Exemple [Date] <TODAY (), "Past", "Future")
Later I put a line chart and put the DataType in Legend column, and in shapes> Customize series I formatted "Future" series as Dotted.
Hope this helps
3 Replies
- walterfjr
Advocate I
Hi TiborTuboly,
I created an example where basically in the modeling area I created a formula to check if the date is past or future:DataType = IF (Exemple [Date] <TODAY (), "Past", "Future")
Later I put a line chart and put the DataType in Legend column, and in shapes> Customize series I formatted "Future" series as Dotted.
Hope this helps
- Greg_Deckler
Community Champion
I am not aware of a way to change the stroke type per line. You could have a different color potentially. Would need some sample data to put together an example. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- parry2k
Super User
TiborTuboly I guess you can achieve this by using couple of measures. Add following measures and put date on x-axis and these two measures on Y - Axis.
Amount = IF( MAX( Table1[Date] ) <= TODAY(), SUM( Table1[Amount] ) ) Amount Future = IF( MAX( Table1[Date] ) >= TODAY(), SUM( Table1[Amount] ) )
To show dotted line for future, go to format tab and under shapes, turn on customize series, and select "Amount Future" and change it to dashed.
This is how output will look like