Forum Discussion
Line Chart with Events
I have a simple line chart that charts POS Sales over time. I have another table that breaks out all US Holidays with their date. I would like to use the US Holidays Table to have Events layered over my Line Chart (See below). Is this possible, either in a standard visual or an Imported Visual?
Current Visual:
Desired Outcome:
Thanks!
11 Replies
- parry2kSuper User
Anonymous you can surely do that, add a measure where date = holiday date otherwise return blank, and then use a combo bar and line chart and use this measure for the bar chart, alternatively, you can also explore error bars.
- AnonymousNot applicable
Good tip! However, it's not 100% what I was looking for. I'd prefer it to be a dashed thin line and the thinnest I can make a bar chart is still thicker than I'd like. Additionally, I'd like the Data Label to show the Holiday. Right now, it just appears as 1 (Count of Holiday).
- parry2kSuper User
Anonymous you can surely show the data labels using custom data labels by creating a measure, that shouldn't be the issue. Did you try error bars?
- parry2kSuper User
Anonymous with error bars you can get this skinny line:
- AnonymousNot applicable
Can you show me the selections made in the Error Bars section to accomplish this? If I try using Error Bars, it needs a value as opposed to text. The goal would be to have what you're showing but with a Text Label at the top or bottom of that line as well. Thanks
- parry2kSuper User
Anonymous error bar setting is to share skinny line, not for the label, dynamic label is in the data label section. Maybe easier if you share pbix file with the sample data and I will put together something for you.
- AnonymousNot applicable
That would be hugely appreciated, thank you! Here is a Dropbox link to the sample file: https://www.dropbox.com/scl/fi/8hdigbhxj1vm14wobpt8s/Error-Bars-Sample.pbix?rlkey=s63d2azw4wvjwf1867fp4s0ea&dl=0
- parry2kSuper User
Anonymous quick question for you, do you want to show the bar when there is a holiday but no sales, for example in the pbix file you shared, Jan 1 is a holiday but there are no sales for that day, the solution is going to be different based on your answer. I assume you don't want to show the bar but want to confirm.
- AnonymousNot applicable
Yes, ideally it would show all holidays regardless of Sales. Thank you!
- parry2kSuper User
Anonymous hmmm, in my opinion not a good approach, reason behind that is you will see holidays thru out the year and when don't have a sales you will have broken POS sales line which I don't think will look nice or good.
- AnonymousNot applicable
I understand what you mean. The reason I wanted to show holidays when there is no POS Sales is because in our database, we report POS Sales for the week by Week End Date so a holiday could be in the middle of a week and not necessarily on the day shown for the Week End Date. Is it easy to showcase this both ways?