Year: 2016

  • Import CSV file to Power BI

    Import CSV file to Power BI

    This post is going to be similar to my previous post about Getting Data.  I figure we better cover some of the basics before going crazy with deeper topics.

    Materials for this tutorial:

    • CSV file with some random data, linked here: SampleData in CSV format
    • Power BI Desktop (I’m using the March 2016 version, 2.33.4337.281)

    After I read the previous version I thought it would be helpful to put the materials up at the top and what version I was using.  If you didn’t know Microsoft has been very active in the development of PowerBI.com and Power BI Desktop.  Right now there are weekly updates to PowerBI.com and monthly updates to Power BI Desktop.

    Starting off like before here is a sample of the data from the csv file.  I’m showing the data in notepad to prove it is a comma separated value file (hence the CSV name).

    csvfile
    CSV File opened in Note Pad

    Alright, lets go get some data.  Open up Power BI Desktop.  Click on the Home ribbon.  Select the Get Data icon.

    Get Data Button
    Button for Get Data

    Now the Get Data window will open.  Next, select the second item labeled CSV from the top of the list on the right.

    Get CSV selection
    CSV selection in the Get Data screen

    Click the Connect button at the bottom right hand of the Get Data screen to proceed to the next screen.  Now the open window will let you navigate to the CSV file you would like to import.  Click the Open button at the right of Open window to load the CSV file.  Finally you’ll be presented with the data view of the contents contained inside your CSV file.

    View Of CSV Data
    View of CSV Data file

    Once loaded we now have our view of all the columns of data in the Fields viewing pane on the right.  From here we can build our visuals.

    Loaded CSV Columns
    Loaded Columns from CSV file load

    Now, lets throw together a quick visual of the data.

    Start by clicking the check box next to the label titled Category and then click the box next to the label titled Sales.  This will automatically populate a table with the categories in the first column and the sales for each category in the second column.

    Table Visual
    Table of Data

    To open up the Visualizations bar click on the word Visualizations.  This will present all the information relating to the visuals. Upon opening up the visualizations pane there is a small yellow square showing you which visual is selected.

    Selected Visual
    Showing the Selected Visual

    Note: The blue pen highlighting shows the selected visual on the page.  As you build more complex visuals there will be multiple visualizations on your page.  When you select a specific visual, all the properties in the Visualizations Bar show all the properties for the selected visual.  The Table visual is highlighted by the red highlight circle.

    To change our selected visual to a new visual we will simply select a new icon in the Visualizations bar. Click the icon that looks like a pie chart.

    Pie Chart
    Pie Chart Visualization

    Cool, but what if I want more awesomeness on my page.  No problem.  Let’s copy our visual.  You can do this by selecting the visual.  To know it is selected look for the slight grey bar at the top of the visual.

    Gray Bar on Visual
    Gray Bar denoting that visual is selected

    Copy the visual by using Ctrl + C.  Click any where on the white space on the page.  This will deselect the current visual.  Then paste an identical version of the visual by using Ctrl + V.

    Two Visuals
    Copy and Paste of new Visual

    Ta-da! Now we are really getting somewhere.  Two Amazing visuals, well not quite.  Two identical visuals isn’t very compelling.  Lets change one of the visuals to a different visual.

    Select the top visual by clicking on it.  Then select the Stacked Column Chart which is the second icon from the left in the top row.  Selecting this icon will change the visual.

    Bar Chart
    Bar Chart Visual

    And there you have it.  You’ve imported a CSV file and generated two visuals.  Nice job.

    Hope you enjoyed this tutorial.  Leave comments if you have questions or if you want to see something else in a tutorial. If you like what you see please share this post on your selected social network of choice below.

  • Import an Excel file into PowerBI

    Import an Excel file into PowerBI

    We are going to kick this blog off with a simple example of how to load data from excel into Power BI Desktop.

    Note: I’m a firm believer of always understanding your data.  If you are receiving data files or extracts from an automated system or from an individual, trust me it will make a difference.  So, make sure you understand the source of the data and how the structure of your data may change over time.  For example, you have have a column that has both text values and number values; or the data may add additional columns in the future.  Thus, the data load into Power BI Desktop (PBID) will need to be flexible.

    Lets start off with some simple data in excel:

    Excel Data Image
    Sample of Data in Excel

    We have three columns of data, two have number in it and one has text values.

    For now we will close out of excel and jump over to Power BI Desktop.  Once the program loads we will click the Home ribbon then select the Get Data button.

    Get Data Button
    Button for Get Data

    After pressing the button a new menu will pop up showing us all the sources where data can be ingested from.  The very first item in the list is Excel.  Click the Excel then click the Connect button in the lower right hand corner.

    Excel Data Source
    Select Excel as Data Source

    After clicking Connect a new window will pop up asking for the location of the Excel file.  Navigate to our sample data called Book1.xlsx you can down load the actual file I used here: Book1  I saved my Book1.xlsx file on the desktop of my computer.  Select Book1 and then Click Open.

    Open Excel File
    Open Excel File Dialog Box

    Next we are presented with the Navigator screen that reveals what is inside the workbook.  There are two sheets.  For now we are only interested in the data on Sheet1.  Select Sheet1 and then click Load.  This will load our data from Sheet1 into the Power BI Desktop data model.

    Navigator Image
    Navigator Selection Screen

    Now our data has been added to the Power BI Desktop data model.  The data and the various columns we loaded can be found in the tool bar at the far right of PBI called Fields.

    Fields View
    Location of Loaded Excel Data

    Tech Tip: Power BI Desktop (PBI) opening the file and loading the relevant data into the memory of the computer.  This has an approximate 4 to 1 compression ratio.  In practical terms this means that a 100MB file will only consume 25MB of file size in PBI when it is saved.  This is extremely useful as the data model can be quite large when loading multiple data files but the PBI file will compress down to a manageable size.

     

    Make a PBI Table
    Make a Data from Column Sales and Category

    Finally, the Sheet1 data table can be expanded into is respective columns by clicking the triangle next to the table icon.  Finally you can drag and drop the column names into the visualization page to begin making visualizations.  For this demo I used the Category Column and the Sales column to make a table.

    By selecting a different visualization in the visualizations bar you can change your data table into a Bar Chart.

    Power BI Desktop Bar Chart
    Data Transformed into a Bar Chart

    Well that is it for the first tutorial.  Share your thoughts and comments below.  Let me know if you have any suggestions on what you would like to see next.

  • Welcome to my Site

    Welcome to PowerBI.tips, this blog is dedicated to learning and developing visualizations for PowerBI desktop, PowerBI.com and for data modeling in excel.

    I’ve been a PowerBI user for almost two years.  My background is in mechanical engineering, and I’ve been migrating into a data analytics and data scientist role.  As a mechanical engineer part of your job is to develop a test, collect data, and summarize the results. In the collecting data phase engineers can collect gigs of data from sensors.  Thus, there is a need to digest that data into what I would call an executive summary.  I need to convey what I tested and did my device or product pass the tests.

    In the past I’ve used access to collect data and summarize. Then using connections or data extracts to excel to produce charts or summary visualizations.

    All of which brought me to where I am today.  I’ve had the technical know how of databases and excel but I lacked the complete tool to build repeatable data to visualization products. This is the perfect fit for PowerBI.

    This is why I’ve decided to share what I’ve learned about data and data visualization to help you get up to speed with the amazing PowerBI tools.

    Hope you enjoy my blog, Mike