Locked lesson.
About this lesson
Line charts are a great way to show trends over time, and we'll explore doing so here.
Exercise files
Download this lesson’s related exercise files. You can download the source data files for the course from the resources section of your Lessons page.
Line Charts.pbix450.8 KB Line Charts - Completed.pbix
450.7 KB
Quick reference
Line Charts
Working with Line charts in Power BI.
When to use
Line charts are useful for showing trends in your data.
Instructions
Line charts and area charts are very similar, with the latter essentially just being a line chart with the lower area filled in. (The stacked area chart is obviously an exception to this.)
Types of Line Charts
- Line Chart
- Area Chart
- Stacked Area Chart
Layout
- Drag your Field into the Axis area. The unique items in this field will be used for the primary axis
- The alternate axis is calculated automatically
- The measure(s) to visualize should be dragged into the Value area
- Legends and tooltips can also be configured
Formatting
- Dragging multiple fields into the Axis area will activate Drill Down
- Dragging multiple fields into the Value area will add another line
- Visual formatting can be done via the fields under the paint roller in the Visualizations area
- Trend lines can be found under the magnifying glass icon in the Visualizations area
Hints & tips
Common Modifications for Line charts
- Rename the Legend and force it to bottom
- Provide a custom title for the chart
- Change the y-Axis display units
- Change the line (or fill) colors
- Turn on Data Labels and customize the series (each series can be controlled separately)
Login to download
- 00:04 In this video we're going to look at line charts.
- 00:07 And Power BI has three charts that are essentially line charts.
- 00:13 The first one is called a line chart.
- 00:16 The second one is actually the area chart.
- 00:19 This is basically a line chart but
- 00:21 everything below the line is filled in with the shading.
- 00:23 So, same kinda deal.
- 00:26 The next one over, though, is slightly different.
- 00:28 It's kind of a hybrid between a stacked column chart and an area chart.
- 00:31 Basically what it does is it holds on to the previous state value and
- 00:35 actually uses that as the base for measuring its next height of line.
- 00:39 So, it's kind of a little bit of a hybrid.
- 00:41 But essentially these guys all sort of work the same way.
- 00:44 I'm gonna go and create a regular old line chart.
- 00:47 And I'm going to go add some sales and I'm gonna add some budgets to my line chart.
- 00:53 And you'll see that I get two data points.
- 00:55 And that's because I haven't really given it a series to work across.
- 01:00 The logical one where I find line charts work really well
- 01:02 is when we're working with dates and times.
- 01:05 Now I don't want date, that's gonna give me too many data points.
- 01:07 What I want is end of month.
- 01:09 So I'm gonna drag that into the axis area and you'll notice that it immediately,
- 01:13 because it's a date field, creates a hierarchy for me.
- 01:16 This is not what I want, so
- 01:17 I'm going to change it right now to say don't aggregate this into a hierarchy.
- 01:21 Just give me the end of month and
- 01:23 I now get a really nice looking little trend for my data.
- 01:28 Now that's cool and everything else,
- 01:29 but what if you have the standard that you're making up and you're working with.
- 01:34 Let's say for a second, when we go back to our Sales vs Budget Analysis,
- 01:37 let's say we did a little bit more to this.
- 01:39 We went back and we clicked the Format Painter and we chose our data colors.
- 01:43 I said, you know what, Sales,
- 01:44 I really wanted Sales to be a really nice dark blue.
- 01:49 So I went into Custom Color and I picked out a dark blue right here and
- 01:53 made really dark blue sales.
- 01:55 And my Budget, I said, you know what,
- 01:56 I really want that to be that nice gold color.
- 02:00 So if I'm happy with this chart.
- 02:02 Notice I put the legend at the bottom.
- 02:04 I've changed my data colors for my sales and for my budget.
- 02:07 I got a nice little title across the top.
- 02:08 Wouldn't it be nice if I could grab these things and port them into this chart
- 02:11 without having to reconfigure it on each and every individual piece?
- 02:15 And we can do that.
- 02:16 We'll grab the chart.
- 02:17 We click the the Format Painter button.
- 02:20 And then we'll go and click on the chart itself.
- 02:22 And you'll notice that many of these properties end up getting pulled over.
- 02:27 Although, it might not be ideal here because we've actually pulled over a whole
- 02:31 pile of data labels.
- 02:32 You can scroll over the chart and you can see the individual data points,
- 02:35 it'll show those things for us.
- 02:36 But do we really need the data labels on here?
- 02:40 So, if we go and scroll back up to the top here, we can say you know what,
- 02:44 let's go collapse data colors, data labels, let's turn those off.
- 02:48 Should I put my Y-axis back on,
- 02:50 yeah, I probably need to gauge what's actually happening here.
- 02:53 So this allows me to actually control the charts individually,
- 02:56 but take some of my common elements across.
- 02:59 So, do I really want this called Sales and Budget by End of Month?
- 03:03 Maybe not.
- 03:03 Maybe I could go back and say, again, let's do a sales comparison or
- 03:08 sales versus budget.
- 03:09 I'll put Sales versus Budget By month.
- 03:13 We don't need the end of in this whole thing.
- 03:16 There we are.
- 03:17 End, End.
- 03:18 All right.
- 03:19 What if I want to see a trend line?
- 03:22 Well that's found under this little magnifying glass.
- 03:24 We go into analytics.
- 03:26 You'll notice that we actually have a bunch of different trend lines.
- 03:29 But I'm just going to grab the regular trend line.
- 03:31 And say add, and
- 03:33 we'll call this one, well, it's called trend line one right now.
- 03:37 It doesn't show on the chart.
- 03:38 I'm practically pretty happy with that.
- 03:39 We can just leave it as is.
- 03:40 So there we go. We've got something that works
- 03:42 quite nicely there.
- 03:43 So these are some of the options that you might want to see and
- 03:46 play around with on your line charts.
- 03:48 There's lots of different things that we can do obviously to play with here.
- 03:51 I would highly encourage you to go and explore more of them.
- 03:54 But notice that those three areas, the fields listed area, where we drag on and
- 03:58 create the chart.
- 03:59 Our formatting area, we can go through and actually control a lot of the elements.
- 04:02 We also have the analytics area, where we can go and
- 04:05 add some trend lines to help add a little bit more to the story of our data.
Lesson notes are only available for subscribers.