First Steps on Power BI and Car Sales Dashboard

Douglas Rocha
7 min readAug 17, 2022

--

Hi! I’m Douglas and I’m a Data Science enthusiast trying to learn everything I think I need to become a Data Scientist.

This post holds my first learnings on Power BI. Yes, I had said I would (and should) learn SQL — or PostgreeSQL, to be more specific — first, but… you know… I didn’t.

No, but really. I enrolled in this course by Data Science Academy on Microsoft Power BI for Data Science. Despite the English name, it is a Brazilian course made all in Portuguese (my native language, if you happen to not read my first posts). In it, I’m supposed to learn not only Power BI but also some Python, R, SQL, and even Apache Spark. It won’t be a full in-depth course on any of those (but Power BI) but will be a good introduction and should help me dive deeper o SQL later.

The first module on this course is pretty introductory and doesn’t hold much reviewable content. But the second module, on the other hand, gives a good hands-on introduction to Power BI and has a short Case Study on Premium Car Sales in Brazil with a fictional dataset. I should here go through this case study and point out some of my learnings. So, without ado:

Premium Car Sales Case Study and Dashboard Report

To begin with, the course presented me with the business requirements for this dashboard. The original text is in Portuguese, so I will sum it up and translate it:

Your manager needs the following information: total sales for each year, delivery cost for each manufacturer, labor cost for each state, total amount of sales and sales matrix. Besides, it would be interesting if the CEO could visualize the total amount of sales by state and if the sales are above or below average.

Your manager also knows the topic of the presentation will be if the company will continue selling the cars made by Jaguar and he would like to know how the sales for this brand have evolved by year and state.

Yeah so… a lot of information is needed. Let us get to it. These are the first few lines of the dataset table:

Yes, it is in Portuguese. No, I will not change it’s language. The dashboard will be in English so it should be enough for everyone’s comprehension.

First things first, the course teaches how to import data into Power BI. To test my skills, they used a dataset with Portuguese accentuation but with English floating points (one and a half, with English floating points, is written as 1.5, but in Portuguese, we use 1,5) so I had some formatting, language, and encoding issues from the start. They were solved by choosing the right encoding but using English as the file's language.

My first goal was to make a chart to resolve the first requirement: total sales for each year. As my first ever chart, I used a simple column chart and it looked like this:

It made no sense to me until I found that the Year (Ano) column was being summed. That made it clear that the Year values had been recognized as integers on purpose so I had to Transform data, turning those integers into text and ending up with the right chart that, after a bit of formatting, ended up like this:

Job done! Next up is delivery cost by manufacturer. My first thought was to make another column chart or at least a bar chart, but the course’s teacher said and I quote “You should not use the same chart twice on a Dashboard to deliver different information”. Their advice was to maybe use a pie/donut chart, but I, personally, didn’t think that would make much sense. My last take on this was to go back to my first idea and make it into a column char, but turn my Yealy Revenue chart from column to line. In the end, I had these:

Although out of order, the next question I wanted to solve was total amount of sales by state and if the sales are above or below average. To do that, I first thought of using a pie chart, wich would in theory be the best choice. But, as one can see here

two of the 6 states (mine included) were not showing due to a huge gap in revenue. I had been keeping the map chart I wanted so badly to use for the labor cost by stat task, but, in the end, had to use it here and ended up with

Where the specific value of revenue by state can be seen by hovering the mouse over each state on the map (not here, on the dashboard). There isn’t an explicit sign of the average revenue, but it is very clear where the line between the most profitable and least profitable states is drawn through the coloring.

Following up we have labor costs for each state, for which I’ve had no best idea (like, at all) than to use a bar chart. It is very similar to the column chart in the sense that I didn’t want to use both in the same dashboard following what I’d learned in the course. But, in the end, there was really no other way. This is what I ended up with:

The easiest question to answer and “chart” to build is definitely total amount of sales. To do that we simply use a Card, as it is called on Power BI. It looks something like this:

And we finish it with the sales matrix, which, I will be honest, I don’t yet know in what differs from a normal table, but I did it as a Matrix and it looked like this:

So, that is it! If you want to ask about the last point, how the sales for this brand have evolved by year and state, that can be seen by just selecting the brand in the sales matrix. I will show it properly to you in the end, with the finished dashboard.

Yes, now is the time to actually build the dashboard. I believe a dashboard can be understood as a Lego structure built of little Lego pieces represented by every single chart, card, and table/matrix. The problem here is that there is a lot of thinking put into organizing those pieces, and a lot of studying has to be made in order to properly set them in a visually pleasing way. I haven’t done that much studying yet, so it may not be the best dashboard you have ever seen. I’ve put the effort to choose an existing color palette at least, hence I believe it will go to some extent in improving the visuals of my dashboard.

In the end, after following that line of thought and what little amount of knowledge on that matter I have already gotten from this course and the one made on Google Sheets, this was the result:

Yeah! Now that is really it. Is it as visually appealing as I wanted it to be? Most definitely not. Every time a make a new dashboard I remind myself of how much I must stop at some point to improve my dashboard design skills, but that should come a bit later than actually making dashboards.

Just to show how, as I’ve said before, one could select a brand in the matrix (or any other brand split chart like average delivery cost by manufacturer) this would be the behavior of the dashboard in such case:

Here the CEO would be able to see how the Jaguar brand has evolved over the years and by state.

In any case, this is my Premium Cars Sales Dashboard case study as guided by Data Science Academy’s Power BI free introduction course. I can’t publish the dashboard (at least just yet) but the file will be available for download on my GitHub here alongside the dataset provided by the course I used. I hope this helped you in any way but really, as I always say, even if it didn’t help you, it helped me tremendously so it’s worth it. See you soon!

--

--

Douglas Rocha

Software Engineer | Working Java, React, SQL and Python | Writing Best Coding Practices, Clean Code and Software Engineering