A complete guided case study in Power BI based on the Kaggle data set.
Today I was trying to prepare some tasty salad and going to some food blogs. I found a good recipe with avocado. As we know avocado is a very good source of vitamins and helps to protect from heart disease. After having a good salad, I couldn’t come out from avocado and found a popular data set in the Kaggle. I started to plan to do some data analysis.
In this blog, I am going to explain to you how I have completed one case study using the avocado price data set using Power BI.
Table of Contents
1. Data Set
3. Learning Objective
4. Import Data
5. Transform Data
6. Data Visualization
I have taken Avocado Prices data from Kaggle for this project.
The data set has 14 columns.
Some relevant columns in the dataset:
Date– The date of the observation
AveragePrice– the average price of a single avocado
type– conventional or organic
year– the year
Region– the city or region of the observation
Total Volume– Total number of avocados sold
4046– Total number of avocados with PLU 4046 sold
4225– Total number of avocados with PLU 4225 sold
4770– Total number of avocados with PLU 4770 sold
The primary objective of this case study is to learn the following things
- Avacado Price Analytics project with sample visuals
- How to create Histogram
- How to create an Infographic view with customized image
- How to create Lollipop Bar Chart.
- Customize theme
- Adding image as the page background
- Let’s start with the Get Data option under the Home tab. As this is a CSV file, select the Text/CSV option from the drop-down list
- Select the file named avocado.csv
- After selecting the file, data will be displayed with options Load, Transform Data.
- Click on Transform Data and Power Query Editor will open.
In Power Query editor, you need to do the following changes.
- Click on “Use First Row as Headers” from the Transform group under the Home tab and observe that the table header is created.
- Give a proper name for column 1, for example, SL No.
- Rename the last 3 column names as Type, Year and Region.
- Click on Close and Apply to save.
- Update Summarization properties for Average Price from Sum to Average.
- Change to “Don’t Summarize” for SL No and Year.
- Update data formatting to decimal number for all the measures fields.
- If you want to verify these above changes or any doubt, please have look at the below video.
Power BI offers different advanced visuals. These are all supported by 3rd party providers.
We need to first import required visuals from AppSource after clicking “Get more visuals” under the visualization section.
Get More Visuals
- Click on Get more visuals under the Visualization section → Click on Get more visuals out of the displayed 4 options.
- Power BI Visuals box opens. Please check, by default AppSource tab should be selected.
- Now in the search box, first type “Infographic” and click on the search icon. Select the first Infographic Designer view
- Similarly, you get the other two custom visual ” Lollipop Bar” and “Histogram”.
- If you face any problem, please check the below video
Create Histogram, Line and Donut Chart
To create a Histogram, please follow the below steps.
- Select Histogram visual from the pane.
- Add Total Bags in the Values and Frequency section.
- Click on the Format section and update Display Units for X-axis, Y-axis. Display Data Label and Give a proper title with some formatting.
For the Line chart, please follow the below steps.
- Keep Month from Date hierarchy in Axis.
- Add the Type in Legend and Average Price in Values
For this chart, add the Type in legend and Average Price in values.
Are you facing any difficulties? , Don’t worry. Here is a video for you.
Lollipop Bar Chart
To create a Lollipop Bar chart, please follow the below steps.
- Select Lollipop Bar Chart visual from the pane.
- Add Region in Axis, Average Price in Values and Total Bags in Tooltips box
- Copy the same formatting from the above chart using Format painter
Here is the video to make you comfortable.
To create an Infographic view, please follow the below steps.
- Select Infographic Designer visual from the pane.
- Add Year in Category, Type in Legend and Total Volume in Measure box.
- For formatting, there are many steps. Here is a video to help you to do that.
Customize Page Background and Theme
To make your report more representable, you can add an image as a page background as well as customize the theme colour.
How to do that? Please have a look at this video.
Please find the code file (Price Analytics) in the below location
I am sure you are happy with this project after looking at your report.
If you have any questions related to this project, please feel free to post your comments.
You can check my Medium Profile for other related blogs and please like, share comments if you feel it will help others to learn.
Please like, comment and subscribe to my YouTube channel which you have already seen. 🙂 Keep Learning.