Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING HTML & CSS BASH RUST TOOLS MATH

Power BI Line and Area Charts


Share

Line Charts Show Trends

A line chart connects values with a line.

It is the best way to show how a value changes over time: rising, falling, or repeating every year.

Power BI has four visuals in the line family:

  • Line chart
  • Area chart
  • Stacked area chart
  • 100% Stacked area chart

Two combo charts mix lines with columns: Line and stacked column chart and Line and clustered column chart.

In the First Report chapter, the line chart used the date hierarchy that Power BI makes automatically.

Your model now has its own Date table, with the hierarchy Year > Quarter > Month that you built in the Hierarchies chapter.

This page uses that hierarchy.

Work in your file from the DAX chapter, for example poke_mart_dax.pbix (see Power BI Visuals for what it holds).

The page uses the measures Total Sales, Sales LY, Sales YoY % and Margin %.


Total Sales by Month

Build a line chart of Total Sales for each month of 2025:

  1. Click an empty spot on the canvas.
  2. In the Visualizations pane, select Line chart.
  3. In the Data pane, expand the Date table and drag Year Hierarchy (Year > Quarter > Month) to the X-axis well. All three levels are added.
  4. Expand Sales and select Total Sales. It goes to the Y-axis well.

The chart starts at the top level of the hierarchy, so it shows only two points: 2024 and 2025. Keep only 2025 with a filter on this visual:

  1. In the Filters pane, find Filters on this visual. Because the hierarchy is on the axis, it already has a filter card for Year, and for Quarter and Month. Expand the Year card.
  2. The card opens as Advanced filtering. Set Filter type to Basic filtering and select 2025.
  3. Point to the chart, and select Go to the next level in the hierarchy (the double down arrow) twice: from Year to Quarter, then from Quarter to Month.

The chart now has twelve points, Jan to Dec 2025. The months are in calendar order, because the Month column is sorted by Month Number.

Month (2025)Total Sales
Jan317,300
Feb289,900
Mar370,750
Apr359,450
May414,500
Jun423,850
Jul510,200
Aug585,600
Sep356,300
Oct363,250
Nov398,500
Dec634,000

The twelve months add up to 5,023,600, the Total Sales for 2025. The line rises to a summer peak in August, drops in September, and ends with the best month of the year, December.

Note: Do not skip the Year filter.

Go to the next level in the hierarchy shows all months without their year, so without the filter, each month adds up both years.

January would show 607,900: 290,600 from 2024 plus 317,300 from 2025.


This Year vs Last Year

One line shows the trend.

Two lines let you compare.

Add last year's sales to the same chart:

  1. With the line chart selected, select Sales LY in the Data pane. It goes to the Y-axis well, below Total Sales.
  2. Drag Sales YoY % to the Tooltips well. It is not drawn, but it appears when you point to a month.

Sales LY is the measure from the Time Intelligence chapter:

Example

Sales LY = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))

The visual is filtered to 2025, but Sales LY still works: for each month of 2025, it returns the same month of 2024.

A line chart of Total Sales and Sales LY by month for 2025, next to the Filters pane with a Year filter set to 2025 under Filters on this visual, and the Visualizations pane with the date hierarchy in X-axis, Total Sales and Sales LY in Y-axis, and Sales YoY % in Tooltips

Point to each month to check your chart:

Month (2025)Total SalesSales LYSales YoY %
Jan317,300290,6009.19%
Feb289,900226,00028.27%
Mar370,750336,35010.23%
Apr359,450301,30019.30%
May414,500378,6009.48%
Jun423,850439,500-3.56%
Jul510,200473,5007.75%
Aug585,600472,70023.88%
Sep356,300277,40028.44%
Oct363,250339,6506.95%
Nov398,500341,05016.85%
Dec634,000516,55022.74%

The Total Sales line is above the Sales LY line in every month but one.

June 2025 sold 3.56% less than June 2024. Over the whole year, sales grew 14.35%, from 4,393,200 to 5,023,600.

The two lines follow the same shape: both years peak in summer and in December.

A pattern that repeats every year is called seasonality.

To make the lines easier to tell apart, make last year dashed: select Format visual, open the Visual tab, expand Lines, select Sales LY in Apply settings to, and set Line style to Dashed.

Note: A chart with two or more measures in the Y-axis well cannot also have a field in the Legend well.

Use either several measures or one measure split by a Legend.



Area and Stacked Area Charts

An area chart is a line chart with the space below the line filled in.

The filled area puts the focus on how big the values are, not only on which way they move.

Show the 2025 sales of each product category as areas:

  1. Select the line chart, and copy and paste it (Ctrl+C, Ctrl+V). Select the copy and check two things: the Filters pane still shows the Year filter set to 2025, and the chart still shows months. If it shows years again, go down to the Month level as before.
  2. In the copy, remove Sales LY and Sales YoY % from the wells (select the X next to each).
  3. In the Visualizations pane, select Area chart.
  4. Drag Products > Category to the Legend well.

The chart draws one area per category.

All three start from zero and lie on top of each other, and Power BI makes them see-through so you can see where they overlap.

This is also called a layered area chart.

  1. With the chart selected, select Stacked area chart.

Now the areas are stacked on top of each other, in the order of the legend.

The top edge of the stack is the total for all categories, the same line as Total Sales in the first chart.

Here are the two versions side by side.

To compare them on your own page, paste a second copy before you switch it to Stacked area chart:

Two charts of Total Sales by month for 2025 with Category as the legend: on the left a layered area chart where the Balls and Medicine areas overlap, on the right a stacked area chart where the three categories are stacked

Both charts use these values:

Month (2025)BallsMedicineStatus HealersTotal
Jan120,400176,30020,600317,300
Feb127,200151,70011,000289,900
Mar186,800163,30020,650370,750
Apr184,200149,50025,750359,450
May198,200192,20024,100414,500
Jun182,200217,20024,450423,850
Jul253,800226,90029,500510,200
Aug310,200248,40027,000585,600
Sep147,800187,60020,900356,300
Oct189,400162,60011,250363,250
Nov173,800203,10021,600398,500
Dec289,600315,90028,500634,000

Balls and Medicine take turns being the bigger category, so in the layered chart their areas keep crossing and hiding each other.

The stacked chart gives each category its own band, and shows the total too.

Microsoft recommends layered area charts for two or three areas at most.

With more, use a line chart or a stacked area chart.

The 100% Stacked area chart stretches every month to 100%, so it shows each category's share of the month, like the 100% stacked column chart in Bar and Column Charts.


Line and Clustered Column Chart

Sometimes you want two measures with very different scales in one chart.

Total Sales is in the hundreds of thousands each month.

Margin % is about 45%, a number below 1. On a shared axis, Margin % would be a flat line along the bottom.

A combo chart solves this with two value axes: columns on the left axis, a line on the right axis.

  1. Copy and paste the first line chart again, and remove Sales LY and Sales YoY % from the copy. As before, check that the copy shows the months of 2025.
  2. Select Line and clustered column chart.
  3. Total Sales moves to the Column y-axis well by itself. Check that it is there.
  4. Drag Margin % to the Line y-axis well.

Total Sales is drawn as columns, and Margin % as a line.

Because the two measures have such different ranges, Power BI gives the line its own axis on the right, the secondary y-axis.

A line and clustered column chart for 2025 with Total Sales by month as columns on the left axis and Margin % as a line on the secondary axis on the right, next to the X-axis, Column y-axis and Line y-axis wells

Month (2025)Total SalesMargin %
Jan317,30046.00%
Feb289,90045.77%
Mar370,75045.03%
Apr359,45045.83%
May414,50046.08%
Jun423,85045.95%
Jul510,20045.74%
Aug585,60045.35%
Sep356,30046.05%
Oct363,25045.23%
Nov398,50045.64%
Dec634,00045.32%

Sales change a lot from month to month, but Margin % stays between 45.03% (March) and 46.08% (May) all year.

The mix of products changes a little each month, and the margin hardly moves.

The line in your chart looks bumpy, because the right axis runs only from 45.0% to 46.0%.

Always check the numbers on the right axis before you draw conclusions.

A two-axis chart can make a small change look big.

The other combo chart, Line and stacked column chart, works the same way, but its columns can be stacked, for example one piece per category.



Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.