Forum Discussion
Showing Last Year Values Jan-Dec when Current Year Only Partially Available - Line Graph
Hello,
I don't think I've seen another post in the forum with quite the same desired outcome...
I have a line graph for Current Year and Last Year values by Month. Both the Current Year and Last Year are calculating correctly, however, being March the Current Year data for April-December doesn't exist yet. I have the graph set to show the x-axis data even if 0, but this doesn't help extend the Last Year values line out to December 2020.
Since there is not data for April-December, the line graph shows the two line values from January to March, but where I expect the Current Year line to stop at April, I want the Last Year line to continue for the rest of the year.
Does any one know of a way to do this?
Thanks,
Alex
Hi,
According to your description, i create a sample to test:
Please try to create this column to replace the original x-axis:
Column = 'Table'[Year]&"-"&'Table'[Month]The result shows:
Hope this can help.
Best Regards,
Giotto Zhi
3 Replies
- Greg_Deckler
Community Champion
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
- amitchandak
Super User
Are you adding +0 to your current measure, typically measures like this should work
Sales = CALCULATE(SUM(Sales[Sales Amount]))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
- v-gizhi-msft
Community Support
Hi,
According to your description, i create a sample to test:
Please try to create this column to replace the original x-axis:
Column = 'Table'[Year]&"-"&'Table'[Month]The result shows:
Hope this can help.
Best Regards,
Giotto Zhi