Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 56 ยท Welcome to Power BI

Build Your First Report in 10 Minutes

Load a small sales file, drag fields into a column chart and a card, add a title and save your first Power BI report, with pandas checking the numbers.

The fastest way to understand Power BI is to build something small. In this lesson you load a tiny sales file, turn it into a column chart and a card, give the page a title and save it. The whole thing takes about ten minutes, and it uses only a handful of the ideas you met in the last two lessons.

The steps are described in words, because they happen in the Desktop application. To show that the numbers on your chart are right, the lesson also reproduces them in pandas. When a step says "Power BI does this", that is the real tool; when it says "stand-in", it is Python.

The data

Create a text file called sales.csv with these rows (copy them into Notepad and save with the .csv extension), or use the same numbers in an Excel sheet.

TEXT
Date,Region,Product,Units,Price
2025-01-05,North,Notebook,10,4.50
2025-01-09,South,Notebook,6,4.50
2025-01-12,North,Pen,40,1.20
2025-01-20,East,Pen,25,1.20
2025-02-03,South,Backpack,3,32.00
2025-02-11,East,Notebook,12,4.50
2025-02-18,North,Backpack,2,32.00
2025-02-25,South,Pen,30,1.20

Each row is one sale: when, where, what, how many and the unit price. There is no Revenue column yet, and we will add one.

Step 1: load the file

Ten minutes, five moves

Load Home, Get data, Text/CSV.
Add Revenue A new column or measure.
Chart Region on the axis.
Card One big total.
1 / 2

On the Home tab select Get data, then Text/CSV, choose sales.csv and click Open. A preview window shows the first rows. Desktop has guessed the delimiter (a comma) and the data types. Check that Date shows as a date and Units and Price as numbers. Then click Load. (The Transform Data button would open Power Query instead, which you will use from chapter 3.)

When loading finishes, the Data pane on the right lists a table called sales with five fields. Click the Table view icon on the left and you will see the eight rows. The data is now inside the model.

You can imitate this step in Python. The stand-in reads the same text with read_csv and shows the types it infers, the same check you do in the preview window.

Python Stand-in: load the file and check types

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Step 2: add a Revenue measure

The chart needs a Revenue number: units times price for each row, then added up. In Power BI there are two places you can do that. A calculated column computes a value on every row and stores it. A measure is a formula that is calculated when a visual asks for it. For totals like this, a measure is almost always the right choice, and the track will explain why in chapter 5.

On the Home tab choose New measure and type this formula into the formula bar, then press Enter:

DAX
Revenue = SUMX ( sales, sales[Units] * sales[Price] )

The measure appears in the Data pane with a calculator icon. SUMX walks through the rows of sales, multiplies the two columns on each row and adds the results. You will meet it again in the lesson on iterators.

The stand-in computes the same total and the same breakdown you will see on the chart.

Python Stand-in: Revenue = SUMX(units * price)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

If you run it you get a total of 400.0, and North, South and East come out as 157.0, 159.0 and 84.0. Hold on to those numbers; your chart should show the same ones.

Step 3: a column chart

Click an empty part of the canvas in Report view. In the Visualizations pane click the Clustered column chart icon; an empty chart appears. Now drag fields from the Data pane:

  1. Drag Region into the X-axis well.
  2. Drag the Revenue measure into the Y-axis well.

Three columns appear: North, South and East. Hover over a column and a tooltip shows its value. Drag the chart's corners to resize it. If the columns come out in an order you do not like, open the ... menu in the top-right corner of the visual, choose Sort axis and pick Revenue or Region, ascending or descending.

You can also tick the checkbox next to a field in the Data pane, and Power BI will place it in a sensible well by itself. Dragging gives you control; ticking is quick.

Step 4: a card for the total

Click a blank area of the canvas so the chart is deselected, then click the Card icon in the Visualizations pane. Drag the Revenue measure into the Fields well. The card shows the grand total, which should be 400. The card knows nothing about regions, so it ignores the chart, and both visuals read the same measure.

Try clicking the North column in the chart. The card changes to 157 and the other columns grey out. That is cross-filtering, one of the most useful behaviours of Power BI: selecting something in one visual filters the others. Click the empty space in the chart to clear it.

The stand-in below shows what happens when you click a column: the same measure, restricted to one region.

Python Stand-in: what clicking a column does

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Step 5: title, tidy up and save

A report that nobody can read is not finished. Select the chart, open the Format visual tab in the Visualizations pane and turn on the Title. Replace the default text with something that says what the reader is looking at, such as "Revenue by region, Jan to Feb 2025". Do the same for the card, with the title "Total revenue". Right-click the page tab at the bottom and choose Rename page to call it "Overview".

Finally press Ctrl+S. Desktop asks where to save and for a file name, for example first-report.pbix. Close and reopen it to prove that your work survives.

Write chart titles as answers to questions, not as field names. "Revenue by region" tells the reader more than "Revenue and Region".

What to try next

You now have a working report. A few small experiments teach a lot:

  • Drag Product into the Legend well of the chart and watch each column split into coloured stacks.
  • Add a Slicer visual with Product to filter the whole page.
  • Change the chart to a Bar chart and see how long labels become easier to read.
  • Add a table visual with Date, Product and Revenue to see the detail behind the chart.

Notice that you did none of the following: write code to draw a chart, reload the data when you changed the chart, or copy numbers into a presentation. That is why people like the tool. Of course real data is rarely as tidy as this file, and the next chapter looks at how to connect to the real thing.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In the first report, which field goes in the X-axis well of the column chart?

    Region is the category that spreads across the horizontal axis. The Revenue measure goes in the Y-axis well as the value.
  2. 2. Why is Revenue created as a measure rather than typed into the data?

    A measure is evaluated in the context of each visual and its filters. That is why the card and each column can show different values from the same formula.
  3. 3. You click the North column in the chart and the card changes. What is this behaviour called?

    Selecting a data point in one visual filters other visuals on the page; this cross-filtering is part of what makes reports interactive.
  4. 4. Which file do you get when you press Ctrl+S in Power BI Desktop?

    Desktop saves a .pbix package containing the report, queries and model.

Summary

  • Loading a file takes Home, Get data, Text/CSV, check the preview, Load.
  • A measure like Revenue = SUMX ( sales, sales[Units] * sales[Price] ) calculates totals on demand.
  • Drag a category into the axis well and a measure into the values well to make a column chart; a card shows a single measure.
  • Clicking a data point cross-filters the other visuals on the page.
  • Give every visual a clear title, rename the page and save a .pbix file.
  • pandas can reproduce your numbers (total 400.0; North 157.0, South 159.0, East 84.0) so you can trust the chart.

Next, learn where data can come from in Connecting to Data Sources.