Transcription
In this video, you're going to learn one of the world's leading business analytic tools: PowerBI.
Imagine mastering PowerBI, the tool that transforms raw data into meaningful insights and opening up endless possibilities for innovation and career growth in 2024. As businesses become more data-driven, the demand for analytics skills is booming. PowerBI leads the way with top solutions in data visualization, business intelligence, and data analysis. Dive into the world of analytics where professionals can earn between $80,000 US to $120,000 US annually and learn how to become a key player in this data revolution.
In this course, you will uncover the basics of data analytics, learn steps to become a PowerBI expert, and get hands-on experience with real-world labs. You'll also get an introduction to advanced features, compare PowerBI with other analytics tools, and prepare for job interviews with PowerBI questions and answers. Finally, explore data analytics certifications to boost your credentials.
Craving a career upgrade? Subscribe, like, and comment below. Dive into the link in the description to fast-track your ambitions. Whether you're making a switch or aiming higher, SimplyLearn has your back.
But before we commence, if you are really interested in elevating your data analyst skills with SimplyLearn's PL300 Microsoft PowerBI certification training, then look no further. This course helps you learn to use PowerBI desktop, create reports and dashboards, and present data clearly. You'll get hands-on experience in real-world projects and labs and access practice tests to prepare for the PL300 exam. Join over 42,000 learners who have rated this course 4.5 out of five. Learn to make dashboards, get better insights from data, and solve business problems with PowerBI. This course includes 30-plus hours of learning projects, lifetime access to content, and live sessions with experts. Check out training options. So let's get started.
Now let's understand why PowerBI is needed. First, PowerBI has the ability to access vast volumes of data from multiple sources. It allows you to view, analyze, and visualize huge quantities of data that cannot be opened in Excel. Some of the important data sources available in PowerBI are Excel, CSV, XML, JSON, PDF, etc.
Second, PowerBI provides an easy-to-use drag-and-drop tool with features and functionalities that allow you to copy all formatting across similar visualizations. PowerBI has exceptional integration with Excel. It helps you gather, analyze, publish, and share Excel business data. PowerBI helps to accelerate big data preparation with Azure. Using PowerBI with Azure allows you to analyze and share vast volumes of data. Azure data lake sink can reduce the time it takes to get insights and increase collaboration between business analysts, data engineers, and data scientists. PowerBI allows you to get insights from data and turn insights into actions to take data-driven business decisions.
Finally, PowerBI allows you to perform real-time stream analytics. It fetches data from multiple sensors and social media sources to get access to real-time analytics. So you are always ready to make business decisions.
Now let's see what PowerBI is. PowerBI is a business analytics service provided by Microsoft that lets you visualize your data and share insights. It converts data from different sources to build interactive dashboards and BI reports. As you can see, we have an Excel data about sales. Using this data, PowerBI helps you build different charts and graphs to visualize the data.
Now that we have understood what PowerBI is, let us look at the important features of PowerBI. First is PowerBI desktop. PowerBI desktop is a free software that you can download, and it allows you to build reports by accessing data easily. For using PowerBI desktop, you do not need advanced report designing or query skills to build a report.
Second, as already discussed, PowerBI supports stream analytics from factory sensors to social media sources. PowerBI assists in real-time analytics to make timely decisions.
Third, support for multiple data sources is one of the major features of PowerBI. You can access various sources of data such as Excel, CSV, SQL Server, web files, etc., to create interactive visualizations.
And finally, custom visualization. Custom visualization is another vital feature of PowerBI. While dealing with complex data, PowerBI's default standard might not be enough in some cases. In that case, you can access the custom library of visualization that meets your needs.
Let us jump into discussing the various components of PowerBI. As you can see, there are six major components of PowerBI. Now, let's discuss them one by one.
First is Power Query. Power Query is the data transformation and mashup engine. It enables you to discover, connect, combine, and refine data sources to meet your analysis needs. It can be downloaded as an add-in for Excel or can be used as part of PowerBI desktop.
Second, we have Power Pivot. Power Pivot is a data modeling technology that lets you create data models. It also allows you to establish relationships and create calculations. It uses data analysis expression language or DAX to model simple and complex data.
Third, we have Power View. Power View is a technology that is available in Excel, SharePoint, SQL Server, and PowerBI. It lets you create interactive charts, graphs, maps, and other visuals that bring your data to life.
Next, we have Power Map. Microsoft's Power Map for Excel and PowerBI is a 3D data visualization tool that lets you map your data and plot more than a million rows of data visually on Bing maps in 3D format from an Excel table or data model in Excel.
Then we have PowerBI desktop. PowerBI desktop is a development tool for Power Query, Power Pivot, and Power View. With PowerBI desktop, you have everything under the same solution, and it is easier to develop BI data analysis experience.
Finally, we have Power Q&A. The Q&A feature in PowerBI lets you explore your data in your own words. It is the fastest way to get an answer from your data using natural language. An example could be: what was the total sales last year? Once you have built your data model and deployed that into the PowerBI website, then you can ask questions and get answers easily.
Now, let's see what PowerBI service is. PowerBI service is the software as a service part of PowerBI. It is also referred to as PowerBI online. To access PowerBI service, you need to log into app.powerbi.com. Now, let me show you that. I'll go to Google. I'll open a new tab and search for app.powerbi.com. It's loading. But this is how the homepage of PowerBI service looks like. I've created some dashboards on it. First, you need to log into app. PowerBI service. You can see I'm logged in. Now, under my workspace, if I go to dashboard, here I have created a finance dashboard; you can see the different charts and graphs I have prepared and pinned it to the dashboard. So PowerBI service allows you to connect to your data, create reports and dashboards, and you can also ask questions to your data.
Now, as you can see in this dashboard, we have created some charts and graphs. So this is a tree map, there's a pie chart, there's a bar graph. Below you can see there are line charts and donut charts. It tells you the total sales that were made, the total number of units sold, the sales by product, sales by country, sales by segment, and lots more.
One of the key features of PowerBI is creating dashboards from multiple reports and data sets. PowerBI dashboard is a single-page visualization to tell a story. The visualizations on a dashboard are generated from multiple reports, and each report is based on one data set. A single-page dashboard is known as a canvas. The visualizations you see on the dashboard are called tiles. These tiles are pinned to the dashboard by report designers. Now let me go back to my dashboard. So this is called a canvas, and each of these are called tiles. So on the top, you can see we have three tiles.
Now let's understand how to create and publish reports in PowerBI dashboards. PowerBI allows you to create different reports on PowerBI desktop. These reports can be published on the PowerBI dashboard using PowerBI service. Here you can see there is a PowerBI report created on PowerBI desktop. If you click on publish, it will take you to the PowerBI service where you can build a dashboard. Here is the button for PowerBI publish. Once you click on PowerBI publish, it will take you to the dashboard. So this is a single-page PowerBI dashboard on PowerBI service.
Now let's understand the PowerBI architecture. PowerBI architecture is a service built on top of Azure. There are multiple data sources that PowerBI can connect to. PowerBI desktop allows you to create reports and data visualizations on the data set. PowerBI gateway is connected to on-premise data sources to get continuous data for reporting and analytics. PowerBI services are basically the cloud services that are used to publish PowerBI reports and data visualizations. Using PowerBI mobile apps, you can stay connected to their data from anywhere. PowerBI apps are available for Windows, iOS, and Android platforms.
Now let's look at a case study on how Meijer, which is one of the United States' largest supermarket chains, used PowerBI to solve its business problems. Initially, Meijer had become dependent on its IT organization to extract insights from its data. It was time-consuming and inefficient, as you had to wait for it to build every report. Meijer was unable to perform ad hoc and real-time analysis easily. So what Meijer did was it connected PowerBI to an on-premises SQL server analysis services cube. This allowed them to refresh 20 billion rows of data in near real-time. With PowerBI, teams can now pull in the data faster and perform real-time analysis to derive insights from data. A bakery department inside Meijer used PowerBI to compare its sales with regional performance. They analyzed where Meijer was behind the regional trends, focused on the problem, and created a solution. With PowerBI, they can now drill down into hourly sales and send out a sales flash to 800 Meijer business leaders. So PowerBI enabled them to standardize data sources and empower store directors and team leaders to develop and track that data to ensure what they can improve.
Now let's do some practical hands-on demo with PowerBI. So this is how the PowerBI desktop interface looks like. On the left, you have the report view, the data view, and the model view. The report view is where you visualize your data with different charts and graphs to build reports. The data view allows you to view the whole data, while the model view is where you check if there are any relationships between the tables. On the right, you can see the different visualizations that you can build. We'll quickly run through all of these in our demo. So here you can see there's a finance sample data that will help you draw insights about the sale of products in different countries. We will create a report to visualize different charts and graphs and analyze those sales. So let me go to my PowerBI desktop.
First, we'll import our data. So let me go to our get data tab and choose Excel as my data source. I click on Excel. So here is our finance sample data. We'll select Sheet1. You can see the data here. Click on it and then select load. This might take some time to load the data. Now if I go to my data tab, you can see the entire data set. It has fields such as segment, country in which the sales was made, the name of the product, the units sold, and the sales price, and many more. Let's start building our report now. I'll go to my report view. So, first let me create a text box. Let me resize it. Let me name it as finance dashboard. We'll increase the size of the text. We'll use font Consolas. Center it. We'll also add a background to this. Use blue color, change it to white, and increase the size. Now let me first show you how you can create a matrix. I'll go to visualizations and click on matrix. Let me resize it. From the data sheet tab, I'll select sales and drag onto values. So you can see the total number of sales that were made. Now let me do some formatting. So I'll go to the format tab. Click on column headers. Let's add a background color. And let me increase the text size to 20. Similarly, under values, we'll increase the size of the text to 20 as well. We can also click on border and choose the color of the border. We'll take as let it be black. So this is a simple matrix that we created which shows the total number of sales that were made. Similarly, let me choose matrix once again. Now, we'll drag on the units sold onto values. We'll continue with the same drill. Under column headers, we'll add a background. This time, let's choose some other color. And under values, let's increase the size of the text to 20. Even for the column headers, let's increase the size of the text to 20. Again, we'll switch on border. Let me resize a bit. So here we have two matrices created for our report. The first matrix shows us the total sales that were made. The second matrix shows you the total units that were sold. Now let's move ahead and create a simple bar chart. So under visualization I click on clustered column chart. Under this, we'll drag the date column onto axis and the sales onto value. Let me expand it. So, it shows you the sales per year. This is the sales that were made in 2013, and this shows you the sales that were made in 2014. Now, there's a drill-down option which gives you more granularity. This depicts the sales by quarter. If I drill down further, you can see this shows you the sales by month. Also, you have some options like sort by and sort by sales. So you can see October month made the highest number of sales. Moving ahead, let me now create a pie chart where we will see the sales by different segments. Under visualization, I'll click on pie chart. Let me first resize it. Here I'll drag the segment column onto the legend and the sales column onto the values. As you can see, we have the sales made by different segments. Government segment made the highest number of sales with 44.22%. Now, let me add a border to both the visualizations. I'll click on the pie chart and go to the format tab. I'll switch on the border. Similarly, for the clustered column chart, I'll go to the format tab and click on border. Now, let me resize a bit. All right. Next, we'll create a very simple table that will depict the total sales made by each product. So, under visualizations, I click on table. Let me bring this below. So, from the data sheet, I'll first drag product onto values. You can see the different products and then sales just below it. So, this depicts the total sales that were made by each product. And finally, it displays the total value of the sales that were made. This is the same as the one shown here. Now, let's do some formatting. Under the format tab, I'll go to values and increase the text size to 15. Let me expand it. Also, under column headers, I'll increase the text size to 15. Then, let me go and add a border. Now let me create a map that will show you the sales that were made by each country. So first let me create a new page and under visualization I'll click on map. Now I'll drag the country column onto location. So you can see we have our map ready, and we'll drag sales onto size. You can see the different countries and the sales that they made. If I move the map, you can see the sales made in the Europe region. Let me resize it. I'll add a border to this. Now, let me go ahead and create a donut chart that will show you the profit by each segment. Under visualizations, I'll click on donut chart. I'll move this to the top. Now, from the data sheet, I'll add profit onto the values and segment onto the legend. If I expand this, you can see the government segment made the highest amount of profit with 65.04%. Let me resize this, and we'll add a border. Okay. In the final visualization, I'll show you how to create a tree map. This tree map will tell you the total amount of sales made by each product. So, under visualizations, I'll click on the tree map. Let me expand it. I'll drag sales onto values and product onto group. So here you can see our tree map and the sales made by each product. You can see now we have our report ready. We have created two separate canvases to visualize our data. Now if you want to change the color of these bars, you can simply go to the format tab and under data colors, you can choose whichever color you want. In PowerBI desktop, you have an option to switch your theme. This will make your dashboard or the report look more attractive. So now we are under the default mode. Let's try out different themes. That's Frontier. It's Temperature Solar, which is a little yellowish. The one which I like is Tide. I hope this was helpful in making you understand the basics of PowerBI and how it works. You learned the various features and the components of PowerBI and looked at the architecture of PowerBI. Finally, you saw a demo to create a report using finance data set.
Now, let's get started by how to install PowerBI in Windows operating system. To install PowerBI, go to Google and search for PowerBI desktop download. Now, click on the first link, and then you will be redirected to the official web page of Microsoft PowerBI. Here you have to scroll a little towards the bottom and select your language, which is English, and then click on download. This will give you two options. So based on your processor, select one. My system is 64-bit. So I'll be selecting this one. Now, the download file will be 558 MB. So it might take a little time. Now you can see your Microsoft PowerBI is getting downloaded. So if we go into the download section, you can clearly see it. So here it is getting downloaded. It might take a little time. Now the file has been downloaded. Just run the file, and you can directly go to next. Since the default language is English, and in case if you want to select a particular language, you can go to the select language option and select your particular language you're searching for. It might take a while. There you go. So the installation process has been started. Now you can click on next. And now you can read all the terms and agreements and click on accept. You can change the location if you want, but I'll be keeping it as default. Again, if you want to create a shortcut, you can on desktop. I'll keep it as it is. Now install. It might take a while. So PowerBI has got successfully installed. You can see the desktop icon there. Double-click on it, and you can start PowerBI. So firstly, it is open source. If you want to have a licensed version of it, just get the license or buy an option. And for now, let's use the open source version. So this is the PowerBI window, and those are the charts, and these are the data connections. If you want to get connected to your data sources, you can also have shortcuts to that.
Now, what are the steps to connect to data? So now we will go directly into PowerBI and try to import one by one a few most commonly and popularly used data sets which are most commonly used in a day-to-day activity. Rest of course, there are PowerBI supports any number of data sources, but we will do something practical on the most popular ones. So let's let's open our PowerBI. Now this is my PowerBI, and first, I want to show you that how can I import data directly from a web page and import the data. Now it is asking for a URL in order to import data. So what I have done is I have created a Google Excel sheet with simple data with rows and columns, and what I have done is I have shared this sheet as published to the web. Okay. So you just need to say publish to the web, the link as a web page, and say done. It's it's automatically published and say link. So copy the link which you have published on the web. Copy this link and then go back to your Tableau. Paste it link over here and click okay. Now PowerBI will try to establish a connection with this Google doc sheet because it's published on the web. You need to wait for a while while it is reading. Okay, now it has read one of the HTML tables. So I'll select this one. Now you can see it has it is showing me a preview of the table which is there on my Google sheet, right? It has 11 rows. So it has showed all the 11 rows. So now I can go and transform this data because I can see my headers are there starting from the second row. So there's an opportunity for me to transform the data. So I'll go and transform it so that it looks clean. Okay. So first is I need to remove the first row, which is the null row. Remove the top rows. Okay. And then I need to use the first row now as a header. So you just click this option use first row as headers. That's it. So now if you see my row ID, order ID, order date, ship date, all my data is now ready. So I can say close and apply. Click apply changes. Now this is an example of web data import.
You can go and preview your data right now. Uh, the biggest advantage of this data connection is that it's a live data. So, for example, I insert another row. Let me change the order ID. Some, some I've changed some basic stuff and I it's autosaved. Control S. Now I'll go to my tableau and I'll refresh. Now you can see as I refreshed my power query editor, I clicked refresh all and I got my new row, which is there in the live data. I got that fetched from my Okay, I got that row, the row row ID number 12. So I I have to say close and apply.
Now you can see the new row, the row number 12 is now available in my new data set, in the data set because it's a live connection. It's a live connection with the web-based Google sheet. Okay. So this is one important way in which you can import data. Now let's try to import data from a text file. Now I have already prepared a text file called subcategories.txt. Now let me just open it in a notepad. Now it's a very plain simple file, tab separated file in which you have product subcategory ID, subcategory name and product category key. So, basically to which product category this particular subproduct belongs to. Right? So, what I'm going to do is I'm going to go back to my get data option and I'm going to select text/CSV option and I'm going to select option mod product subcategories.txt. Okay. So now PowerBI has identified that it's a tab delimited file. It has recognized the headers, etc. Right? And I can now directly load this file. Okay. So now once the data is imported in PowerBI, it is like irrelevant to me. It's a composite data in import, right. So in my presentation when I'm talking about importing data, there are different importing modes, right? Import data import can happen through different ways. Okay. One is direct query mode in which I create a live uh connection to the database, which I'll also show you uh using MySQL and MS SQL server and also you can do a composite mode in which you can have data imported from Excel plus you can have direct query modes, so you can have multiple uh modes to connect and create a composite data model, and that's what we are doing right now in our practical. So what we are doing over here is one, we have imported data from the web. Second, we have imported data from a text table.
Now after doing text now our next task is to import from CSV. Let's try another one. So now I have imported product subcategory. Now I'll import a CSV file. So again I'll choose the option text/CSV. And now in this CSV file, let me open this CSV file and show you what in is it. So this is a list of all my products: Product key, product subcategory key, product uh stock keeping unit, etc. A simple CSV file and I'm going to import that. Okay. So now it has identified the delimiter is comma rather than a tab and it has already recognized the headers correctly. So I'll load it. Okay. So now my products are there. Product subcategories are there for product categories. Now what I have done is I have created an Excel mode now. So now Excel I'm using to import my product category. So now I have to click on the option of import data from Excel and I'll say product categories. Select the sheet. Load. And now so my products, product categories, product subcategories do with different uh uh data storage types, but still now the data is imported into PowerBI, it is a composite data model. Now another very important data type which you can import is the PDF also, right? So what I have done is I have created a PDF called customers; my customer's data is lying in a PDF, so what I've done is I've created a PDF. Okay, which has data for some columns are there like you know customer key, prefix, first name, last name, birth date, marital status, gender, email address, annual income, total children etc., etc. So this is the data set which I have created in PDF. So what I'm going to do is I'm going to select PDF now and import customers PDF. And see it has recognized my table on page one, which I'm going to load. Okay. You can rename this as PDF table. Okay. So this basically these are the different type of data types we have imported: PDF, Excel, text, CSV and web page.
Now let's take a look at another interesting data set which we want to import is the MySQL server data set. So what I have done is I've already installed MySQL server on my local instance and there's already a schema of SQL live tutorial over there and I have certain tables already prepared over there like department employee etc. So my goal is now to import this data or create a live connection with this data set. Now in order to import my SQL database connection in PowerBI, you need to first download a connector, MySQL PowerBI connector. So you need to go to this link and then click on download and install the MySQL connector based on the operating system you have. You click on download and install it. After you have done this, go back to PowerBI and then give the IP address of the database. In my case, it's there in this local machine and the schema which I want to import is SQL live tutorial. So, I'll give the name. Click connect. Okay, now it's connected. So now it is asking me which particular tables you want to create a connection with. I'm choosing department and employee and I'm just loading them. Okay. So now this is the exact data which is there in the employee and department in my SQL. Okay. So this is one example of how to create connectivity between PowerBI and MySQL.
Now I want to do the same thing using SQL Server, Microsoft SQL Server. So I have also installed Microsoft SQL Server on my machine and I have used the SQL Express. So this is the name of my server. So which I'll copy the server name and go to get data. Select SQL server and for now database is optional. I can say direct query. Click okay. Okay. Now it is showing me what all tables I can import. So in my SQL server tutorial in my SQL server I have I have these three tables: customers, employee, attrition, Olympic events. So I can use probably the customers one which is Now you can see this is the data, the customer's data which is lying in my SQL server. Okay. So I can preview it and load it. So now you can you can preview the data in uh PowerBI that this this is the data. So I can rename is customers from MSSQL and this is from my SQL and okay. So now this is not the only uh data sets you can import. Now if you take a look at the options which PowerBI gave of what different type and variations of data it can it has compatibility to import from. Okay. So we can just take a look at the categorization on the left hand side first. There are file based like Excel, text, XML, JSON is also possible. You can evenly directly import entire folder and within the folder whatever uh data types of files are there it'll detect it. PDF, park key or even shareepoint folder which is itself a Microsoft uh technology. Then different kind of databases: SQL server and MySQL we just saw, but it's not only limited to this. You can connect to Microsoft Access, SSAS, Oracle database, IBM DB2, Postgress, uh, Caiase, Terodata and then SAP uh, uh, databases, Amazon, Red Shift, Impala, Vertica, Snowflake and any number of databases which are there in the market today uh, Amazon etc. Then it also allows you to connect with its own power platforms. PowerBI platforms, data mods, PowerBI data flows, data vers etc. Azure, there are different kind of storage uh mechanisms in Azure and Azure itself is a Microsoft technology. So it has a compatibility with lot of Azure uh based data stoages like Azure SQL database, blob storage, uh Azure data bricks, right? Azour HD inside Spark. So if you have those kind of services running on your Azour cloud services, you can even import them over here. Now online services like you know you have ERPs running uh or some data which is shared on the internet if you want to import it uh that is also possible through certain products uh Dynamics 365, Microsoft Exchange online, Salesforce, Google Analytics, Adobe Analytics, GitHub uh LinkedIn sales if you want to do some analysis of some social networking uh you know feeds that also you can import. Then other miscellaneous are also there. Web based, hive, R script, Python script if there's something to import, get data from uh Google sheets like we saw one example in our video right now. So there are multiple options available.
Now once you have imported the data which is relevant to you um in our subsequent sessions we will see how to create relationships, but just giving you a glimpse that whatever data you are importing PowerBI auto detect certain relationships and it'll create for you, but then you can go and manually also change. So this is the composite data model which is getting created in the back end while you are importing the data. You can easily go and manage these relationships, either keep them as is, you can delete and create new ones manually. So there is no limitation in that. So this is what we have witnessed. We have imported data from different files types, data types and then you know we have tried to once it is imported into uh PowerBI then there is no limitation of how you use it. You can create visualizations across different data sets and then create your standard reports. So this is the example of importing data from web, importing data from a database, from a PDF and then once you have data, you can shape and combine data. You can basically do what whatever transformation you want to do. You want to uh make joins, merge the data. So for example, if we go back to our PowerBI and if I go back to my transform data section. Now as I have now different data sets available with me, I have I can do any kind of u you know operation transformation on the data, right? Uh so like I showed you I uh upgraded the header row because one of the imported data was not showing the header correctly. uh or this columns like this exact one column is extra. I can remove the column, right? All those transformations, whatever I do in the back end gets captured in the applied steps section, right? This is the customer data. You can create uh you can merge it, you can append it uh you know with other data set, right? Let's for example, I want to create a merge data set of my categories and subcategories. So I can say mer select these two data sets and say merge queries as new and I can select product categories and product subcategories. Select product category key on both the sides and then take do a left auto jog jog jog jog jog jog jog jog jog jog join. So whatever product categories are there, I'll get the subcategories associated with it and I'll create a new table which will have now I have the table which has the category and the subcategory and subcategory in one table itself. So I can rename it now to as category subcategory table. It's a it's a merge. Basically, it's a join between category and subcategory. And now I have a common table, right? And I can close and apply. So imagine I have created a new table which is imported created from one data set is which is Excel based and another data set which is text based. See this category subcategory table. So now I can use it the way I want in my visualization reports. So that's what the presentation says right that once you have uh the imported data you can shape you can combine you can adjust you can do whatever transformation you want to do and create your visualization.
What is PowerBI? It is a business intelligence tool to visualize your data and share insights across your organization. So when we talk about BI, it came into existence as a self-service BI tool and it does have different components which can be used. Now before we get into details of PowerBI, let's understand what are the different components or what are the different ways in which you can work on your PowerBI. Now one of the main challenges when it comes to organizations or users is that data is scattered in different places. It might be in different formats and anyone everyone would want to use that data to basically perform some calculations create visualizations or dashboards which could be interactive and that's where they would want to bring all the data in one place might be transform it so that you can filter out and not load huge amount of data in your system and you can work on selective data. So when it comes to PowerBI, it helps us in ETL, it helps us in data modeling, it helps in data storage and reporting. So what are the benefits of PowerBI? Here are some of the benefits. So extract intelligence rapidly and accurately. So that's basically transforming your enterprise data into rich visuals and accurate reports for enhanced decision making. Now one thing we already know that when we talk about data data in raw format might have lot of hidden information. If we look at different data sets which I'll show you in the process, it might have lot of meaning but then the real meaning comes out of the data if we can create visualizations, if we can create relationships between different data sets and thus that can help us in enhanced decision making. Now PowerBI supports advanced data services. It integrates seamlessly with advanced cloud services like Cortana to provide results for the verbal data queries as well. When you talk about seamlessly integrating with existing applications, that's one more benefit of PowerBI. So it adopts analytics and reporting capabilities easily to embed interactive visuals quickly in your applications. You can build rich personalized dashboards. So it basically provides a unified user experience with customized dashboard and reports that meet your exact needs. It also has a way where you can have secure way of publishing your reports. So you can set up automatic data refresh and rapidly publish reports allowing multiple users to avail the latest information across your organization or across your working community. So PowerBI can connect to different sources. We'll see that in a while. So basically you have an option which says get data and that basically opens up a window where you can find different type of data sources such as Excel, your CSV or text, JSON, PDF, getting data from databases or directly accessing data from databases.
Now before we get further into understanding how PowerBI looks like, it would be good idea to share information and how you can set that up on your machine. So when it comes to your PowerBI and let me open up a notepad here. So for example, I bring up a notepad. Let's say when you talk about your PowerBI components. So you basically have PowerBI desktop and that's mainly your playground or that's mainly used for any kind of development activities. You have your PowerBI server or you can say service. Now, this one is where you would make reports online and share or make them [Music] available to different BUS. Now, that's one more component of PowerBI. And then you also have your powerbi mobile which is mainly for viewing the information or I would say viewing reports. So these are the three main components. We can also look at the licensing information of these. So these are the main. So PowerBI desktop is something which you can set up on your laptop or on your machine. PowerBI server is where you can login with your user ID and password. and PowerBI mobile is mainly to view your reports. Now, how do you set this up before you can explore or start working on PowerBI? So, here is a link which you can basically use. So, if you look into this, so this one basically says service self-service sign up for PowerBI. It says sign up of PowerBI service as an individual. Normally when you would want to use PowerBI you can use a website called HTTP and then you have basically app and let's say I think it's called app powerbi.com. Now this is the place where you can basically log in. Now if you see here I have created an account and if you look at my account it says auatl.onicrosoft.com. Now how do you get this kind of email? Because when you talk about powerbi it will expect you to have a official ID and it does not take ids which are from common domains such as Google or Yahoo and so on. So this particular link gives you an idea how you can do that. So basically you have what is PowerBI basic explanation on that. It says signing up for PowerBI service. So PowerBI desktop it's a totally free download and then you have mobile apps also a totally free download. And here it says that what kind of email addresses it supports. And if you look into this, you have to either sign up because that does not accept your private email ids or you can go for this one which says enroll US government organization and this is where you can basically sign up for powerbi. So it basically says try free if you go to the website say powerbi.microsoft.com or you could go into this one which I was saying http slash app dot your powerbi.com and this is what you can use or as mentioned you can go to powerbi.microsoft.com for example if I open this in a different tab it takes me to powerbi microsoft I can say start free I can click on this it says try free but then when it asks you to sign in this is where some of us face problem because it does not take your private email ID. Now, how do you tackle that? What you can do here is on this page which says learn about alternate ways to sign up. You can basically open up this link and in this link it says sign up for PowerBI with a new Microsoft 365 trial account and what you can do is you can basically click on this link which takes you to the Office 365 and what you can do here is you can search for something which says say 365 E3 and here you have tried it for free. So in my case it is translating. Okay. So here you have an option which says try it for free. Click on this one and then basically go ahead with your sign up process. Now once you do that you can basically create an account or give a email ID. So it asks you to give an email ID to check if you already have an account. And once you do that it will guide you through the process where you can create an account like I have done. Now once you have done that so for example we can go into my this page which I said http/app powerbi.com. Now once you have created an account you would be asked to login. Now I can click and login here and then basically given my password and once I do that it takes me to the powerbi server or service. Now on the top right it might say that go for a trial version. I have already selected that and this is a prot trial which is giving me validity for 60 days. So this is the service which I can use. Now what it means is I can be using my PowerBI desktop which would be also installed. So once you log into this page, you can basically click on apps. You can basically search for something like PowerBI and that will show up an app and you can install and download on your machine. Now once that is there you can basically bring it up. So for example in my case I can just say PowerBI desktop and that's the app which I have installed on my machine and basically that comes up. So that's your PowerBI desktop which is coming up and it will still ask you to sign in so that you can share your information through PowerBI. So you see here on the top I'm already signed in and here it also shows you some tutorials and videos which basically helps you in getting to know something more or what's new. So you can always browse that. So you would have your PowerBI desktop which would be set up. You would also have your PowerBI service which would be running and then basically whatever you have developed on your PowerBI desktop you can share that through the PowerBI service. Now usually when you talk about licensing I can give you brief insights here. So you basically have your PowerBI service as I said licensing. So you have the pro version which is basically uh your $9.9 per user per month and basically it has some kind of limitation. So it has say max 10 GBTE. You can work on u some features like incremental refresh is not allowed. You can always look onto the Microsoft website for more details and in those kind of cases you usually go for the premium account if you are a extensive user and premium account basically is conditional based. So it depends on your requirements and then basically you pay for the service.
What you use. So that's mainly about your servicing.
Now when you talk about your server and service, as I said, it is basically making your reports online and sharing and making them available to different BUS. So that is the highlight. So when you talk about sharing reports, that's one of the things you have. Anomaly detection is also possible here; you can talk about automation of reports. You have security, that is, you can go for role-based or role-level-based kind of security implementation, and all those are some of the features of your PowerBI server and service. So it is good to know and basically have your desktop and PowerBI service set up.
Now once you have that, then you basically have your PowerBI. Now when you talk about your PowerBI, it basically helps you with various things. So this is how easily you can have it set up and then basically you can explore this.
So, for example, as I was saying, PowerBI can connect to different data sources. Now I do have an option here which says get data. I can click on this, and that shows me all the different data sources. I can even click on more, if I am interested in looking at what more PowerBI desktop tool helps me to do. So it shows me all the different ways in which you can get the data. You see here the server, so the database services, your folders, your different formats. You can click on file formats or databases. You can look at power platform. So if basically you are connecting to a platform and getting some services, you can connect to the cloud, that is Azure. You have online services, and then you have other options. So these are all the ways in which you can get your data.
When you talk about visualizations, you see a lot of visualization options here which can be used once your data is loaded. And I will explore and explain more about this. So you have something called as insert, wherein you can go in for different visuals or different types. You can also get into, say, transform the data. Now that basically is going to pop up and bring a power query editor. Now that's where a lot of your ETL works happen. So when you when you do a transform data, it opens up power query editor which we can use to transform the data, or change the data, or modify the data as per our requirement before loading all of it into our powerbi.
So you also have an option here which says modeling, wherein we can create new tables or we can work on our data where we can manage relationships. So as of now we don't have any data. So it does not show this one as activated, but that can be activated. This is where you can view your reports. So this is in short exploring your PowerBI. We'll see what are the different options which we can use here. So it basically supports different kinds of data.
So when we look at the visualization pane, that basically allows us to create different kinds of visualizations here, and we will understand that. So you can basically visualize on your different data and create different kinds of charts, graphs, maps, and basically derive insights from your data.
Now when you talk about data models, that's where you can basically establish relationships. So when you talk about data models, it is basically used to connect multiple data sources to build a relationship. Now we might have different data sets, or we might have data coming in from different tables where we may want to basically get insights or get data from multiple data sources for our purpose. Now in that case, data models do help us.
So, for example, if you have two tables, let's look at the standard tables. So you have products lookup table and you also have the sales table. Now usually what you have in any kind of scenario is if we basically say you have your data tables. So that's basically where your data resides, and then you have series of your lookup tables. So usually you might have say your data tables here, and this is what I'm talking about, which might have some data, for example, let's say sales is one of them; you might have some other data table which might be, for example, let's say budget table or might be something else, and these are your data tables. Now at the other end you might have your lookup tables. So basically you have various lookup tables, and these lookup tables, for example, let's say this one is customer, this one is territory, let's say this is product, and let's say this one is a calendar. So these are basically my lookup tables.
So we can basically, as I said, your data might be coming in from different sources. Let's say database, or let's say some kind of files, or let's say some kind of systems what you have. So your data might be coming in from different places. Now you might want to transform the data. So this is where I could say there is your query editor which I was explaining. So you have your query editor which basically allows you to edit the data table or basically allows you to edit the data before it is loaded. Right? You can hide a column, you can add a new column, you can modify your column. So your query editors would be basically used to work on the data which goes into your data tables.
Now you might have a lot of lookup tables, as I said. So let's say these are my lookup tables, and these are my data tables. So what we need is sometimes we need information based on our lookup tables and data tables. Now that's where data modeling comes into picture. So basically if I would want to extract information from here, so I can notice that there is a product key here and there is a product key here. Now this is where we are already talking about say foreign keys, or we are talking about your relationships. Right now, when you talk about relational databases, you have something called as foreign key constraints, which is in in PowerBI terms I would say it's not exactly a constraint, but it is more of a filter propagation instead, which is used to basically connect your different data sources, and you could have basically the cross filter directions. You can go for single or one to one or one to many or many to many kind of relationships which basically allows you to work on the data. So we will learn more about data models when we are doing a quick demo there where we can talk a little bit about normalization and denormalization, the way the data exists, right, and then you basically would want to gather insights from your data.
So when you talk about your two data sources, as I said, so you have a products lookup table, you have a sales table. Now if you would want to calculate the total order quantity of each product name, which is we are talking about the order quantity as information here, and you have product name here. Now how do you get that information? What we see here is we would want something like this, or we would want more information. So how do we do that? So what we can do is the order quantity for each product is basically showing us the same value. Now this is because the product and sales tables are not connected, and there is no relationship between them. Even if you would want to take two sources and just get information out of them, PowerBI would complain that there is no relationship established between them. So what we do is we create a data model. So what we do is we build a relationship between both the tables using a common key column which exists in both cases. As I said, there is a product key here. There is a product key here. So that basically allows us to have a relationship between these two. Now that could be one to one. This could also be related to other tables. So it could be one to many. You could have many to one. So all those relationships are possible. So product key is basically used to create a relationship. You see the arrow mark, and then there is also this star which can basically mean one to many. Now when the product key is used to join these two tables or form a relationship, then we can look at the product names and the order quantities, which basically gives me a total. Now that's the basic use of your data models.
Now what about this DAX? So basically data analysis expressions. Now that's a a library of functions and operators that can be combined to build formulas and expressions in PowerBI desktop. Usually when we work on our data sources, when we would want to connect them, it automatically shows us these data analysis expressions. However, this gives us extension. It basically gives us more power to work on our data. Now sometimes instead of working on DAX or DAX expressions, it would be good to go for better data modeling and have the relationships established better. And sometimes when the relationships are established, you could use your tax which basically gives you more power on working on your data. So your values are calculated based on information from each row of a table. It appends values to each row in a table and stores them in the model. It increases the file size. So that's what happens. Now you can right-click on any column to add a new column. And for example, in this one it shows that there was a quantity type calculated column which was based on the calculation, what we see here on the top in the in the expression bar which says what kind of calculation was performed, and that basically gives us the value for quantity type, and that is basically added here to our existing data. So that's the power of DAX and PowerBI.
So you also have something called as uh measures. So DAX allows you to create new calculated columns and measures. So basically here if you see we are working on AW sales, and then we have selected quantity sold, and what we are looking in the report is we can basically right-click on any table name to add a new measure here. So we have added what we call as quantity sold as the measure. So values are calculated based on information from any filters in the report. We will see this how this can be done, and that basically here the measure does not increase the file size. It does not create new data in the table themselves in comparison to what we were seeing earlier, that is your calculated columns. So these are your type of DAX functions. So DAX allows you to create new calculated columns and measures. So you have date and time which basically allows you to work on date and time data or fields. You have logical functions which allow us to create new filters or add more filters to our data. You have text functions which basically allows us to say transform the data into a lower case or an upper case or basically get the length of a string or concatenate two fields or basically uh do a filtering based on some criterias or replacing some content. You also have statistical functions which can be used. You have information functions which can be used. So these are different types of DAX functions which we can use in PowerBI.
So we will learn more on PowerBI through a quick demo where we can use some data sets, and those data sets could be found on the internet, although I can also upload that on a GitHub link and you will have access to those data sets. So let's learn about PowerBI through a quick demo by uploading some data sets and playing with those data sets. Let's look at a sample data set and let's upload it, and as I explained while uploading, let's also transform the data so that we can have selective fields or selected data loaded here instead of loading the complete data set. And then let's see how we can visualize this or how we can use the information in this data set.
Now what we can do here is we can click on get data, and then we can choose one of the data formats which we would be looking for. So, for example, I can go for Excel and basically click on this. Now here are some of my data sets. So let's look into the folder here, and these data sets are also available on my GitHub link which I'll share with you later. So here we have something called a superstore. Let's click on this, and here I already have a data set which is global superstore, or I also have selective data. So let's select this one. Click on open. Now that's basically connecting to my data source, and that will show me what does that Excel sheet have. So it has different tabs which is orders, people, and returns. So let's select orders. And that basically gives me a preview of the data which I have. And if you scroll all the way to right, it shows me city, state, and then country. And if you see here, we do see information of all the countries. Now this can be a huge amount of data which may which we would want look into. But say, for example, my use case is that I'm interested in looking for the data for United States and uh as a country and all its states. So we will do that when we do a transform. Now we can also select the returns tab, and that shows me these three fields. However, the first row should have been the heading of this uh particular data set, and we will transform that. Now I can go ahead and click on load, but that will load all the data. So instead of that, let's go for transforming. So let's click on transform data.
Now once you do that, it brings you your toolkit. That brings you your power query editor which allows you to transform your data. So, for example, we have uh data from returns tab or returns data source as you see here. So we see column 1, column 2, and column 3, and that also shows the type of the data here. It also gives me a quick small option here. Let's select this, and then I can say use first row as header. Now there are various other options which you can do. You can add a custom column. You can add column with examples. You can keep the top rows. You can remove the top rows. You can keep errors, keep duplicates. So there are different ways, and you can also do a merge query or append query. So as of now let's just say use first row as headers. And that basically shows that now my first row has become the header. You also see in the applied steps, it basically tells me if I have changed the type of the data, if I have made any other changes, those steps will get added here. So it basically shows me the name as it returns. It shows me applied steps where I have changed the type, and now I basically have this information. Now this is something where you can change the type or you can basically set it to a particular format. However, we are not doing anything of that sort right now. So we can do that for any of these columns. So this looks good. When it comes to orders, let's click on this. And as I said, I would be interested in selecting for country as United States only. And let me just work on that data. However, we can work on all the data. So let me scroll all the way to right, and here I have the country. Now there are these filters which we can use. So basically I can click on this, and that shows me all the countries are selected. Now there is also something called as text filters which we will see how we can use to select particular data. I basically have other ways of filtering the data. So, for example, now I will just uncheck this select all, and what I would be interested is in United States. So let's type it here; that shows me has an option here. Select this and then basically say okay. So that should basically now filter out, and it shows me the data is United States only, and then you have different states and rest of the data remains. So if you look at the applied steps, it tells me that there are filtered rows. Now we have done the basic transformation for this data set on these two data sources, that is orders and returns. So here you have an option which says close and apply. So close the query editor window and apply any pending changes. You can click on this and it says apply. So, for example, I can just say apply for now, and that should basically apply the changes which I have performed using my query editor, that is I have transformed the data so that I can have selective data uploaded in my PowerBI. Now it's doing that; it shows me it is working on both of these data sources, that is orders and returns. So that's done, and now basically if there are any other pending changes we can just do a close and apply. So that basically has closed, and now you would see the data appearing here. So I have uploaded the data as per my preferences.
Now if you click on the data tab here, so it basically shows you your data fields. It might take some time to populate, but if you see in the country field, now if even if I click on the filter it just shows me United States. Now that's what we wanted. So we have already uploaded this data in orders. You can always expand the option here which shows me all the fields which are there in this might be this is an aggregation might be that's an ordered date. So this is again some kind of aggregation. So we can change the data types. So we are looking at all the fields in my orders table or basically coming from the orders data source. I also have returns which shows me three fields, and that shows me the data which is returned order ID and region. So the column names are applied correctly as we want, and that basically looks fine.
Now we can also look at your model. So when you click on model, it shows me these two. However, there is no as of now relationship established between them. So it says under properties, select one or more model objects to set their properties. So right now these are not related. There is no relationship established between them. So if I would want some data which relates to orders and returns, then that would fail because it would say there is no relationship. Now I can go to the first option which says report, and we have not created any report here. Although we can create a simple report. We can look at the data. So we have our orders field. Now we can basically pull out some information from here. We can choose what kind of report we may want to create. So, for example, let's go for uh the table option from visualizations. You have various options here which we can use. This is where you can do a formatting. This is where you can select the fields. This is where you can search and filter out the data. You can also add data fields here. So first let's click on table, and that basically gives me a table. Now this table as of now does not have anything. So you can use the filter and slices option here which will affect the visualization, or basically what you can do is now since we have orders here. So this is my orders, and I would like to work on this. So let's say, for example, country is I can select country as a field, and if you say it shows me country is all as of now, and it says the value is United States. What I can also do is I'm interested in the states. So I have state. Now I can basically drag and drop it here, and then the state gets added here. So I can basically say select all, and that should basically take care of my state field being added here. So state is all, country is all. Now we can basically look at something else. So maybe let's choose sales, and I can just drag and drop sales here. So that basically says if you would want to have any kind of advanced filtering which says filter type, so go for advanced filtering is less than or equal, or you can also go for advanced filters. So that's fine as of now. So we have added some fields here, and that's basically my data here. So let's go for filters here which basically should select all my fields. Now if you see the visualization shows my country, sales, and state which we had either by selecting the fields and dropping them here, or you can in this section where it says fields. So you can, for example, let me show it again. So I can just delete this. I can click on the table option. I can just drag it here. I can basically make it bigger. And I need to add data to this one. So it says add data fields here. So now let's say country is what we are interested in. We are also interested in states. So let's drop that here. And let's say sales. So this is also what
I'm interested. So I'm looking at one specific country. I'm looking at sales per state, and when we look at sales, it basically tells me that this is a summation. So you will basically get the total sales which have happened.
Now we are looking at this data here. We can always go to formatting. We can click on grid. We can basically increase the font here. We can change the grid color. So, for example, let's make it, for example, blue. So I can just select this, and it should basically allow me to have the grid color as blue. Now I can go in for the grid thickness. I can go for row padding, outline color. So we can basically make it a little bit more readable. And then we can basically increase the font size here to look at the information. And you have other options here. So what would you want to do with column headers? So I can basically have the font color. Background color is fine. Do you want to have an outline? Do you want to have a change in font? What is the text size? Maybe we can make the heading a little bigger. And then basically you also have the field formatting. So all those could be done. You could go for background, and all these things can be done in formatting.
So now we already have our data here, and this basically looks good, and this is basically one of my visuals which I have here, and this has given me some information for sales, and basically I can scroll this. I can also make it bigger. So I could select a particular field if I'm more interested in looking at the information for a particular state. Now I can add more fields to this. So this is my one of the reports which I have created.
Now what I can do with this report is I can basically have more data fields. I can add filters to this. I can basically look into all the data here by just clicking somewhere in the grid, but somewhere outside if you select a particular row, then that data shows up. Here you have an option of focus mode which you can go for. You can look at the other options which says export data. Now if this is the data which you are interested in, you can export it. You can always do show as a table. If you are interested in, you can do a sort by country, sales, or state. So, for example, let's do a sorting by state, and that basically gives me the data which has been sorted by state information. Now we could obviously have the information here. So I can then change the order. So it shows me alphabetically; this is the information which I have. So I've created a simple visualization using the data which I have, and what I can do is I can click on save. So that basically asks me to save this as a PowerBI file which has an extension of PBIX, and I can basically call it my report. So let's say first report, and here I can say country or I can say statewise sales in USA, let's say USA, and that basically is my first report. Now, once you have saved this report, you can always look on your machine. For example, if I go in here and if I go into this folder, maybe I should look on desktop, and this is where I should have saved it. So it shows me first report statewise that will open up in PowerBI, and we have created a simple report which we have basically used by taking our data.
Now I can also do is I can publish this if I would want to share this information. So publish this report online in PowerBI service. You can basically select your report what we have here, and I clicked on publish. So it says what's the destination. So you can have different workspaces. I will choose the default. That's my workspace. I can click on select. Now it says publishing first report statewise sales in USA to PowerBI. You can create a portrait view of your report, and you can do all that stuff. So let it publish, and then we can basically look into our PowerBI server, that's our service where the information is already shared or published, I would say, which can then be shared with different resources. So we can come here, and basically I can look into the PowerBI, and this is where I will be able to look into my workspaces, and let's look in my workspace. So it says this is the place where I had initially downloaded PowerBI data set. It says your data set is ready. Let PowerBI help you explore your data. Right? So you can always do this. You can click on view data set which basically allows you to bring out your workspace and first report state wise sales.
Now that's the report which we have published. So let's first check in our desktop if that's done. So it says success open first report in PowerBI. Now I can click on this one straight away, and that takes me to my service. Now once it takes me to the service, it shows me the report which we created which we published, and it basically has the option where I can save it as a a different copy or give a different name. I can embed this in in a website or a portal. I can publish to web embed this report for public access by anyone on the internet. We can do that. We can export it to PowerPoint. So we can do all these options. You also have an option of view where you can change the view. You can basically also edit report here. So you can do that if you are interested in something specific. You can do a sharing to teams. So if you have your teams or groups set up, you can share it with them. You have an option of common panes. You can basically view usage metrics report. Now that can be sometimes helpful. You can basically go ahead and go and subscribe a particular report. So if there are new changes made, you will be the one who will be informed. You can click on share. Now if I click on share here from my service, it says only users with PowerBI Pro will have access to this report. Recipients will have the same access as you unless role level security on the data set further restricts them. So I can grant access, and this is where I will have to give the email ids of the people with a message that I would want to have them look at this report, right? You can also allow recipients to build new content using the underlying data sets, and you can send an email notification to the users. As of now I don't have any other groups, so I'll not be sharing it, but I have created a simple report. Now let's also look at edit report. Let's just to see what it helps us.
And when you click on edit report, it basically brings up this one which says your file view. It gives you the filters. It basically allows you to add data fields to this. So it is basically giving access to these data sets which were in my desktop. It is basically allowing you to give or create different visualizations. Now here we have the data which we are looking at, and if say, for example, somebody is interested in filtering the data. So you could do that. So you could click on filter here, and that basically applies. This is the filter we have. Now country is fine; sales, maybe I can click on sales, and I would say okay, let's look at sales which is more than a particular amount. So we can say is greater than, and maybe I can give a number here. So I can say 30,000, and basically I can say apply filter. So right now I'm applying filter, and I would look at the values which also shows me the total value is changed. So you have not only created a report, you have published it, and now from the service you can edit it. So I'm looking at particular data here, and then basically I can click on file, and I can save it or I can say save a copy of the report, and let's say I will call it the same name. So I'll say first report statewise sales and I will say modified. So let's do a save, and the report has been saved. So now you're looking at the data here. So that is basically giving you information. So when I click on my workspace here, I can click on reports, and that does show me my previous report. It shows me the modified report. It gives me an option of looking at the usage metrics report. So say, for example, you want to click on this one, and it will basically give you the usage metrics. So let's click on this one, and that basically shows me the report usage metrics which is generated. So views per day, unique viewers per day. You would want to look at the different platforms, who was using it, views by user. And this can be sometimes useful if we would want to look into this one.
Now I can go back to my workspace. I can click on reports. And that basically took me to usage metrics. I could be sharing it. I can analyze in Excel. I can look for quick insights based on this data what we have. You can basically look at the related information. You can also look at the settings of this one. And basically this is how you have your data report here. Now that also shows me the data sets option. So which basically gives me the data sets which can be used to create further reports. And we have our data here. So, for example, if I click on create report, it basically gives me these data sets, and we can continue working on this. So this is how I have a simple report created without basically working on two different data sources, but I have selected some data here, and then I can basically add details to this. So, for example, now if we look at orders and say, for example, this is the data I have and say you would want to add some fields. So let's go to returns and say, for example, I would be interested in looking at the the products. So maybe what I should do is I should replace the report here instead of country. It would be interesting to look at the product which we have or basically customer ID. So we can look at customer ID. We can look at the order ID which would be interesting to see if there is a particular order what was the sales which was generated and if there were any returns which were happening on that. So, for example, here when I have these, let me cut out country as a field, and I will basically take order ID and place it here. So now if you see my data has been easily modified. So I have my order ID, I have sales, and I have statewise information. So you have basically all the information, but this is now order ID, state, and so on.
Now what if I would want to also see based on the order ID if I say I would want the returned field. So, for example, I would want to take this one and let's drag and drop it here. Now that says cannot display the visual. Now why is that? So if you click on see details, that says cannot determine relationships between the fields. So it cannot display the data because PowerBI cannot determine the relationship between two or more fields. And how do we fix that? So, for example, if I click on fix this now, it says there is a missing relationship between these fields. Use auto detect to search for relationships or create them manually. Now I can click on auto detect which will try to search for fields which exist in both the data sets or basically I can create relationships. So let's click on create relationships, and that basically takes me to this page which says there are no relationships defined from table to table and so on. So I can click on new. Now here it says select the tables and the columns that are related. Now I can say orders. Now those are my fields where you have order ids, and it automatically shows that returns also has an order ID field, although all the values might not be same, but this is how you can create a relationship, and it says the cardality says many to one, so you can have basically many to one relationship; you are saying cross filter direction is single, so make this relationship active, and it has already helped us basically identifying the field. So I can say okay. So it says now these two tables should be related or should be connected based on order ID. So here we have this, and let's basically say close.
Now once that is done, if you see I have order ID, I have returned, I have sales column, and I have state. And if you see in return I do have a value of yes which shows this particular order ID had generated some sales and it was for state Alabama and it was returned and the value is yes. So if you scroll down, you basically see all the values. Now we can add different filters where we can say I would want only yes and no. Now this is again an interesting report. So let's go in also into the formatting, and what we can do is we can look at say the grid option if we would want to basically say vertical grid and let's say on, and it says vertical grid color. So let's select this; maybe I can try doing a black here. It puts it in a right nice table format, and that basically looks good. So you have sales returned and so on, and this is basically the order which I'm seeing here. So, for example, if I would want to change the order and if I'm saying okay, I would like to look at sales and returned and so on. So we can be doing that. We can come here and say, for example, I have sales and returned. Let's try moving the sales column over here; maybe state is an information which we would want in the beginning. So let me also move the states all the way here. So it gives me state, it gives me the order ID, sales, and if there was a return which was happening on that particular product. So easily I've modified my report. Now what I can do is I can just save it, and I can do the same thing. So I can publish it. I can basically continue using it or I can work on a new report. So let's continue learning.
And now here we will also see how you can load some data and perform some transformations and basically get multiple results or multiple tables or multiple data sets which can be then further used for reporting. So PowerBI does give you a lot of options. Now here you have an option as we saw earlier that is get data, or what you can do is you have an option where you can create new data also which says enter data. Now this is something which can be easily used if you have relatively less number of fields. So you can basically add more columns here, and you can basically add values. So, for example, if I would just call it something like um scientist ID, okay, and then I can say scientist name and then basically I can say uh [Music] domain and then I can say, for example, let's say year of joining and and I can keep adding the number of columns. Here I can delete the columns, right, and I can give this and I can say country. So that's it. And now we have created these five countries, uh sorry, five columns which we have given some names, and we can start entering some values. So I can basically say let this scientist ID be 22 34. I can give some name. So let's give Peter. Let's say domain, and I can say biotechnology. I can give year of joining 2011 and I can say Germany as the country, and I really don't want this particular column. So I can go ahead and delete this. Now I can come here and then I can give something else. So I can say this is scientist ID. I can give John; let's say the scientist is mainly working in physics, and then I can say 2018 and let's say France, and go back here and let's say 4567 and let's say Marie and let's say uh she does her research in uh molecules, and let's call it 2001 and let's say Italy. Okay. And you can continue adding datas in this way. Now you can say if the data is already here. So I can say, for example, no, I do not want this particular row. I do not want this particular row. So you can basically keep adding values here. Now you can say edit. So here we have to give some name. So let's say scientist. Okay. And then if you choose edit, it basically brings up your PowerBI editor which allows you to work on these fields if you would want to make some changes. Now we can make some changes here. We can see what are the number of rows. We can basically perform any kind of transactions here. So this one basically tells me what is the data type. So here we see scientist ID, and this clearly tells me this is an integer. However, we will not want to do any kind of computations here. So we can as well change this. So I can just do a right click, and I can work on this particular column. What I can also do is I can just click on this, and this tells me that you would want to change it to date time or you want to change it to some number. So I can just say string because we are not going to perform any computation here. So on the ID column, so let's say text, and I'm changing it. So it says replace current add a new step. So selected column has an existing type conversion. Would you like to replace the existing conversion or preserve the existing? So I will say replace current. And now the data type has been changed. It is of a string. And if you see this step has got added here. So it says that the change type is the kind of transformation we did here. So that's fine. Now what we can also do is we have the scientist name, but we don't like the column name here. So it would be good to change this. So there is something called as remove or remove columns and so on. So when you do a right click, it gives you a lot of options in applying filters or doing some transformation. If I just click on this one. So what I can do is I can look at the date time and let's go here. So we have an option which says do you want to change the type? Now we could have done that here or like I said you could choose the time and do it. You can just say transform and how do you want to change it. So do you want to change it to uppercase? Well, you can do that and changes all the values of this one. What I can do is I can again do a right click and I can choose basically if you would want to clean up the data or if you would want to convert to lower case, you want to capitalize each word. So let's choose that. And if you see here the steps are getting added. Now to undo any particular step, if I just cancel this, then I'm back to this. If I cancel this, I'm back to my original form. So you can anytime undo your changes, and you can basically work on this. So we are working on this particular column. Now there are various other options that you can look at. So, for example, these are this is some of my data, but it does not have much information. It would be good to load some bigger data set and then use these transformations or basically working on changing the data types as I mentioned or if you would want to do a filtering and remove certain fields and only select particular fields if that's what you're interested in doing a right click where I want to create a copy of this and then basically I can use that particular copy. Now what I can also do is I can add column from examples. I can duplicate column, and then I can make some changes to that. So this is my duplicate column. And say, for example, you would want um this one to be changed. So we can say remove duplicates. We can basically if you're doing some kind of change, you want to change the format here, you can do that. You can use for other things like filling up and all that. Now I can just call it rename and let's say um alias scientist name, right, and I can continue adding columns or I can do some transformations, and once you have done with these transactions, now this one if you see it shows as integer, but is it an integer? No, this is an date format. So I can go for modeling and change the formats. What
I can also do is I can select this, and it says it's not a decimal. It's not a fixed decimal. It is date time. It is date. It is date time and time zone. Right? And you can select any one of these. So, for example, let's make it date, which makes it more meaningful. But then what happens is when you do this, it is going for the default dates or the older dates. So I don't like that. So what we will have to do is we will have to basically transform this. And here we have transform; you have change type. So you have date and time, you have date, you have time. So let's choose date and time. And if you see here, it gives me some default timing based on these values which we do not like. So again, filter it out. But what we can do is we can just make sure that this is changed, or you want to make it a string because we are not going to do any computation here. So I can keep it as date. But then if I have more fields like month and days and so on, then you can do that. So here it also has the option. So when you have selected this, you have an option called transform and transpose, uh, sorry, transform also has various options which allow you to work on these. Do you want to do some scientific calculations? Do you want to work on the date field? So, as of now, it is just integer. So we can use one of these. We can do a group by. But obviously, we don't have much data here. So, as of now, let us retain this. I can just change this to text, and that's okay because we are going to look at this later. We can add more data and work on it.
So, as of now, once we have done all these changes, you can go back to say home, and here you have close and apply, and I can basically say close and apply. So the changes will be applied, and then my new table which we just created by entering some random data performing some basic transformations will be available. So if you look into this one, so that's where my data is. It shows me the columns, but there is no aggregated column as such here. You don't see any summation mark. You just see the field names or the column names. You see the values. Now, obviously, if you go into modeling, there is no, or there is no existence of a different table which you can join these tables, or you can perform some transactions. Come back to the data set. So this looks good, and we have it here. Now, obviously, we have not created any visualization based on this which we can, and we can continue working on it. So over here, this is my data set which is a small table where we have created some data, and we can use it anytime.
Now let's work on a bigger data set and see what kind of transformations we can do. We can then also see on modeling or basically using some smarter ways of working with the data. So what we would want to do is we would want to load some data here. So let's go [Music] into, sorry, let's go into home, let's go to get data, let's use our old store data, and I'm going to take the global superstore, which is a huge data set with all the countries and the products and the sales which have happened, and we can take this data, but before loading it, as I suggested earlier, we should basically transform the data; we should basically transform the data so that you don't end up loading everything and you don't work on all the data. I mean, unless you really want to. So here I will, this Excel sheet which I'm talking about has two different tabs. We have used it before. So let's use orders. Let's use returns, and that basically shows me the data what we have. So I can do a load, but that's not what we would want to do. So you can do a load, and you can get all the data, but let's go to transform, make some basic transformations before we load the data. So our Power BI editor allows us to work on this. Now here we have it says this preview may be up to 9 days old. So I can do a refresh. I can select this, and I say first thing is use first row as header because that's what I want. So it is basically setting the first row as header which looks good. And we have some order IDs. We have the returned if the product was returned. So let's look at the filter here. So it just has yes values which we are looking at. So it says list may be incomplete. Let's say load more. And let's see what are the filters here. So either there might be a product which is returned, or it might be a blank field. So that is chosen. So that's fine. We have order ID. We have region which is basically showing me different regions here. Let's look at orders. And orders is again having your row ID, order ID, order date, ship date, ship mode. So you have quite a large amount of data here for your different countries. Now in earlier example, I chose United States, and then I was only focusing on the states and city in United States. So we can do that. Now I can basically work on refresh. So whatever preview was stored in the memory, we are just refreshing it. Now here we have this row ID, and if you see the row ID is an integer. Obviously, we will not be performing any kind of computation here. So here you don't have any row ID, but here we have row ID. So let's make it uh from integer, let's make it string, and I'll say replace current. So that's that looks fine. It's a row ID which we will use to search, but we are not going to perform any computations unless you want to find on an average on row ID or anything else. Now you have order IDs. So what we can do is we can filter some values. We can rename the field as we desired. Right? So, for example, let's go in here, and what we can do is let's go into uh customer ID ship. Okay. And here you have say state, you have region. Okay. Now at any point of time if I would want to filter out the values, the easier option is that you can select on this one, and here you can do some text filtering, okay, or you can basically select the values from here. So, for example, if I say let's get rid of select all, what we will be interested in uh say United States and UK, that's the data we want. And then I can basically say okay. So it is basically going to filter out the data which is for United States and UK as of now.
Now what we can also do is how about doing some more filtering before we basically work on this? So let's go in here, and we are looking at United States and UK related data, and let's look at it is sometimes good that you can basically uh work on the data here. So, for example, I go into orders. Now what I would want to do is I would want to look at the fields. Okay. And we want to, we have not yet loaded the data. So if you look in the background, I just have my scientists because we have not applied these changes; we have not loaded; we are still in the transformation stage right now. What we can do is let's go for, so we can do segment and all these kind of fields can be used for grouping the data. So we will see that whenever you have a data set, you would already know there are certain fields which have repeated values which can be used to group the data, and we can do that; we can change any kind of values which are not going to be computed on. So, for example, I have postal code; I can use this, but again, we are not going to find a postal code which is greater than something, right? So integer is not the valid type. Let's change it to text. Okay. And um if, for example, I would want to look at this. So I have done some changes here. Okay. And this shows me null. So, for example, let me just revert this back, and let's make it a whole number. Okay. So there are certain columns or rows which do not have some values, and we can basically get rid of those values. So, as of now, we can do a filtering here. So let's keep the postal code as integer, or let's change it to text. Do a replace content. And now what we will do is we'll scroll all the way right; might be I'm interested in technology category. So that's what I'm interested in. So what I can do is here I can do some filtering. So I can basically choose technology. Now the easier way would be since these are categories and there are only three categories. We really don't want to go and apply text filters here. But if you had something like an office supply and um office inventory, then you could have done some text filter. So let's not do some text filtering here. What we can do is I would be interested in technology. So that's the field I'm interested in. So now you are only having data which is related to technology. Okay. And you have some product names. So this is where we want to do some kind of filtering. So we can rename the field. We can select some fields. So let's, for example, let's go for uh any of the field which I think might have more entries here. So, for example, let's go for Canon wireless or Canon image. Right? So let's go for product names, and I will say let's go here. Now I could have done a transformation, but that's not what we want. We want to do some filtering. So let's go to text filter. And here I can say begins with. I can say ends with. I can say contains. So let's go for contains. And it says enter a value here. So you would want to keep the rows where the product name contains something, and it gives you some suggestion, right, so where you are seeing in some values here. So, for example, if I would have selected this, then it applies the complete thing, but that's not what I want, so I will get rid of all this, and I will say it contains canon. Now I can go for advanced filtering also, okay, wherein you can select advanc advanced, and then you can give different columns and what do they contain, what kind of values you're looking for, so you can do that, but we will not go for advanced in one step; let's go for basic and let's say okay, and now I should get all the products which are canon, and you have different products, so this is one kind of filtering I've done; it tells me what is the category of this; it is machines; it is copy years. It is obviously belonging to the technology category. We are looking at uh the market which is for this particular data. When you look at the country, we are still focusing on United States and United Kingdom that kind of data, right? So we have filtered the data. We have done some uh selection based on the data here. And what I can do is I can then basically rename a particular field. So I can do that. I can say I'm interested in um sales which is the data here. We can basically look into the quantity. So sales is something which we are interested in. But might be we are interested in sales which are more than a particular value. I'm not interested in lower amount of sales. I would want to look into United States and UK data, but I'm interested in sales, or I'm looking at if the discount percentage was something or if the profit was more, right? So we can apply different kind of values here. But what we can do is with these changes because you don't want to transform and make changes all here. You want to make the changes once the data set is uploaded. So we have selected some data. We have create done some transformations. We can basically break a particular column into multiple columns if that's what we want. If we see that we will do an aggregation based on year or we will do an aggregation based on the country or year and order ID. Right? So we can break this data into multiple columns. So we can do that. But for now, let's do a close and apply, and let's apply this. So that's going to apply all these changes. It's going to load my data. But remember now we are having selective or selected data which gets loaded. So that should get be available here. So it takes time sometimes. So you have to wait, and then you can go ahead and check here. So, for example, now I'm looking in tables. Let's basically minimize this. Let's go for orders, and this is the data I have which obviously row ID if you see, so you have all the row IDs, and again again you can do filtering here, but this is where you have already loaded the data; the data is available, and then you can start working on the columns here. So we have this; if you closely see, we see this summation mark, and this basically means that these are my aggregated columns or these values are measures which can be used for calculations. So we can see that we can create our own aggregations. So we can do that. We can rename the field as we have seen. We can filter out the data. So we have all the fields showing up from orders. And let's also look at the returns which basically has the columns the order ID and your region. So it basically shows the region here where was the product returned from, and we have this information. So what we are doing is we when we were doing a text filter in the previous example, remember it was case sensitive. Okay. And you have to take care of when you're doing a text filter, you have to give a field which exactly matches as it exists in the content.
Now, okay, this is the data we have, and let's look at the order column. Right? Now, what we can do is we can do some quick transformations here, and we can basically look for more data here. So, let's say we have uh some filtering to be done. Now I can do a filtering based on my uh product. So we had all these products, but now let's do a filtering on product, and then products you have copiers, you have machines. So you have mainly two categories, right, and when you look at machines, it basically talks about your PC uh something. So let's look for machines. And here we have basically the copier fields which are more. So I can basically go for filtering here, and that's the data we have. So we don't want to really unselect any of these here. But what I'm doing is I'm saying text filter, and let's go into this one now, and let's say contains. Okay. So I'm saying contains, and then I can basically say uh let's say copier. Now that's what I'm interested in, and uh show rows where product name contains copier. Okay. Now you can give an and condition here. So if you would want a specific copier, if you are interested in, okay, let's also say uh contains and let's go for laser also laser and let's say okay. So you see the data gets filtered out here, and uh we have the sales which we are seeing here. So let's go to sales. And we will be interested in anything above 500. So let's go to sales. Let's go for number filters. Let's say greater than. And I will say, for example, 500. Oh, sorry, 500. Okay. And uh let's say okay. So that basically filters out the data. And then I am also interested in quantity where I would want the quantity to be more than one or more than two. So, for example, so let's go in here, and you can basically choose what is the filter you want. So you can apply any number of filters. Now you have the filtering here. You can always click on the filter, and if you want, you can just do a clear filter, and the filtering will be gone. So you have all the data, right, and this is the particular data we have, and here I have say, for example, product name. Now I can keep the filter because I'm interested only in these values, or I can filter out. So this tells me that when we did an and, it is basically going for laser and copier, right? So let's say, for example, clear all filters, the thing is gone. What we can do is let's go here, go for text filters, say contains, and here I will say it can be a copier, okay, or so last time we did an and, and I'll do a contains laser. So let's choose this. That gives me more entries. So either the product name has copier or it has laser. It has the quantity. It has the product name, and we have all this detail here. Now what we can also do is we can do some transformation on the product ID. So, for example, you have product ID or order ID. So order ID shows up as uh looks like the country name uh the year and then the order ID. So we can basically split it up. So I can select this, and here I have an option of let's go to home. So when you have, you have selected this column, so you have an option of transform data here. So use the power query editor to connect, prepare and transform the data. So if you really want to transform the data here, if I basically select this, if I just do a right click here. Now here it just tells me do you want a new column? Do you want to create a copy of this column? Okay, you want to create copy table. So this is your transformed data what you have. And, for example, let's create a copy table. and let's come in here. So you should be able to see your copy table now. So let's go in and select this one. And what you need to do here is creating a copy of this or copy table would not be the right option. What we can do is we can work on transforming this rather than doing it from here. So you have this option of adding a new column, going for a new measure, renaming it. Right? So that's okay. But what we can do is select this particular column. Let's do a home. And first thing is let's go to transform. So I want to transform the data. Now let's select this one. and it brings up your power editor again. Here we were interested in orders. So we are looking at our data here. Now if you see my countries United States and UK, so you can confirm that if you look at category, it is technology; product name has copier and laser as we selected. So those things are retained. So you have not lost any changes as of now. So this order id column what we have now, as I said, you can be doing a filtering, okay, you can select this particular column, and then you have other things which can be used to transform here, like you want to change the data type, you want to use first row as header, you want to replace some values, okay, you want to run some merge queries, you want to do some analytics, so all these options are here. Now what we can do is while this column is selected, I can do I right click. Now there is an option called transform which is basically going to help me in changing the data here. Okay. Now I can basically duplicate the column. So I really don't want to work on this column itself. But it would be good to have a duplicate column on which we can work on. So I can do a split column here if I would want to. But let's create a duplicate column. So let's say duplicate column. Now that gives me a duplicate column. So we can rename it later. So now I will not work on my original column, but I'll work on a duplicate column. And what I'm going to do is I'm going to basically transform or split this. So again, do a right click. Now you have a split by. So we can say split by by delimiter or by number or by characters or by position. So by lower case and uppercase. So you can do all of this. So let's go for by delimiter. Now if you see, it basically identifies the delimiter which is hyphen or dash. Now you can go for split at leftmost identifier, right, sorry, leftmost delimiter, rightmost, each occurrence of delimiter, and that's what we want to do. You can look into advanced options where it says split into columns. So do you want to split that into columns? Do you want to split that into rows? because that's more or less like doing a group by, and you can say number of columns to split.
Into. So we have here 1, 2, 3, four values. So that looks good to me. And uh let's do say, for example, if I choose three. So I can choose three and then split using special characters. So you could do that.
So let's, for example, let's say okay, and let's look at the data, how it looks like. We can anytime delete the data; we can keep it the way we want, right? So what we did was we created a copy of the column, then we did a split, and what we have seen is we just have three columns now. If you see the fourth bit is gone; fourth bit doesn't show up, right? Because I just did a as the resulting column. So I have the order ID. Okay. And we can check if there is already an order ID column. So we have order ID, but that has the complete order ID, year, and the relatively product ID. So you can see the customer ID. You can look at this one. So it basically has your order ID.
And then let's look at the fields here. So we have the product ID which says T E C M A. I'm looking at the first one, 37000, and that has in no relation to the order ID. Right? So we can make sure that there is nothing which is conflicting with our entries.
Now, once that is done, so we have order ID which can be used to categorize the data. You have order ID which is basically the year. Okay. And you have order ID which is basically having some more value. Now I can keep this data as I want. So I can basically click on this. I can go for renaming, and I can say let's say, let's call it order id and let's say ids. So let us, in case there is a particular column and you would want to look at. So just give the name correctly. Now order ids is fine. So here we will also rename this one. So let's call it uh order year, and that's going to be order year. So we can again change this to string. Okay. And here you have the order ID. So let's rename this one. And I have my let's call order number, right?
So we have, we are seeing all the steps which we have added here. We just split the data based on the delimiter, and we have now three new columns which have got added to our existing data which was already filtered, and we have done some splitting up of data by creating a duplicate and then renaming it. Right. So if you go and look at your transformations now, if I would have done a split here straight away, then my original column would be gone. But probably we want the original column because sometimes you may want to search order ID which I consolidated information. Sometimes you may want to segregate it based on year. Right now we have the year field or order date field. Here you have the ship date, right? But then might be you want to just aggregate based on year. You don't want to really spend time in aggregating or extracting the month and day and so on. So my these three columns can be useful.
Now what I can also do is I can merge the columns if I want. So we have split the columns, but what I can do is I can say select, select, select. So using your control and now do a right click. So you should have an option called merge columns. Right now this is something which is uh we would want to merge. So let's say merge columns, and let's say do you want to keep a separator? So yes, I want to keep a separator, but might be this time I will give my separator is a uh colon, and then what is the merge column name you want to create? So let's call it something like um order. Okay. Uh year, and then let's call it num. Right. So sometimes renaming the fields to a name which makes more sense or based on your naming convention is good. So let's do a merge. And now what I have done is I have done merging of those columns. So I split the data. I merged the columns. And now if you see my the columns which I had created, those columns are gone because you did a merge. You did a merge. And now you have the fields which are either uh earlier you had something which is separated by a hyphen, and here you have something which is separated by colon. Right? Now anytime if you want you can unmerge this by removing this step. Right? And you can get rid of this merge columns. So if, for example, I would do that. So I have my data back, right? I have my data back.
So what we could have done is we can select this. Okay. And then what we can do is like what we did earlier. So you can basically go for removing the columns. Okay. You can do a merge column. Okay. You can select one by one and create a duplicate of those, and then you can merge them. Right? So all the possible options are there. So you can the best option would be to create a duplicate of these columns and then basically merge them as per your convenience. So maybe you can say order ids and order number is the pairing what you want. Here is something which you don't want, right? Because we already have the date field. So I can basically say remove, and this one is gone. Now I will select this and this, and let's go for merge columns, and I want to give a separator which is might be without the ear and you have space, or you can go for custom like earlier we had give a symbol, and then what do you want to call it? So let's say order specs. Okay. Right. So this makes more meaning because we already have the date field. So why do I want the year into my order ID? So I can always be doing a segregation now based on order specs. Right?
Now this is some simple transformations. What we are doing here? We are seeing the data which we have. Okay. Now what I can do is I can basically first apply these changes so that all my changes what I have done are applied. Right now once these changes are done, we can basically go ahead and save this file. So I can just say save. I can go for save as. I have different other options. So if you would want to perform keep performing your transformation, then you can just do this; you can add a column; you can view the data. So for now our transformations are good enough, and what we can do is we can basically go back to home. We can do a close and apply, and we will be back to our data set which has been modified. So we can see if the data what we have has been transformed. So we have order specs here. That's good. We did not do any filtering or uh we we have the filter left here which basically tells me that there are these different fields. We have not removed them. But what we are doing is we are just applying a filter to choose copers and laser printers. So that's what we have here, and this is good enough.
Now what I can do is once this is done, I can basically save it. So I would want to call it some kind of report if you would want to create. Okay. So let's call it as uh uh let's say second report. And here I will say country and technology specific info. Let's save it. And now basically I have saved my data. So what you can do is you can go for creating other reports or basically having this information published if that's what you want to do. If you want to go for visualization because right now what we are seeing is we have lot of data here. We have lot of data here. It shows me there are these uh tables or data sets which we have worked on that shows me here in the models, but there is no relationship with them. If you go into visualization, then you don't have any option or you have not created any visualizations based on this data. But if you go here now based on the data what we transformed, if you see we have order specs right now that's what we chose; we basically have other fields, so you have ship date; you have aggregated columns which can be used for visualizing, and we can work on this, so I can come back here, and what I would be interested in is this data set is fine, but I want to do some grouping; I want to basically have some selective data in this, and for that what I can do is uh let's go for ship mode. Now this is something what we have. So we are in this data field. Now we have this transform. So let's go back to transform again and let's choose our orders. So that's the data we have. And now if you see here this is, you know, huge amount of data. What we want is we want to group them based on the shipping mode. So here you have an option called group by. So I can select this. I can go in here. I can basically work on okay, get rid of duplicate values, but that's not what we want to do. You want to do a group by. So as I said, you can do a group by from here, or you can choose from the transform option above, and you can do a group by. So let's do a group by. Now how do you want to group the data? So I'm saying I want to group the data here based on shipping mode or which is the other column you want to use to do a group by. So let's go for shipping mode. And what is the new column name, right? So we want to basically find out that you want to go for ship mode, but that's not enough; I mean, I can do a ship mode and I can do a grouping by, but you want to just count the rows; no, that's not what we want to do, so let's go to advanced; so ship mode is fine, so that's your grouping, right? But then what we also want to do is we want to do a grouping based on say sales. So here, for example, let's go for sales. Okay. And what should we call this? So might be we can say uh shipment wise sales, whatever you would want to call. So you can basically get the operation. Do you want to really count the rows? No. We want to basically do a summing, or we want to might be find out an average price, right? So let's do a sum, okay, and here I would want to do a summing based on say, for example, sales, so this is what I'm going to use for getting a count of the sales now grouping by might be we will change this instead of uh instead of sales we are using a ship mode. What we can also do is let's go for a segment, and that would be valid grouping. So it will take a combination of ship mode segmenting group the data based on that and then get me the sales which is which is basically let's call it shipment wise sales. So it gets a sum. So let's do a okay, and that's my more relevant data which I'm looking at. So I'm looking at the ship mode. I'm looking at what is the segment, and then I'm looking at what is the total sales there. I'm looking at again the ship mode standard and home office. So always remember when you are choosing multiple fields or multiple columns for grouping by, you are basically having a combination of two fields. So that has to be unique, and your grouping is done based on that. So now you're looking at the sales wise, and this is something as an important information what we have. So we have done some transformation, and what you can do is you can use other ways like you can use pivot to get individual values from it. You can run on merge queries which is basically running some merge queries and merge the query with another query in this workbook if you have. So you can go for this. Now I can basically go for apply and close.
So just to add to the group by step, what we did was if you see here I have removed the group by filter which we just did a couple of minutes back, and what I have done is instead of transforming your complete data set, you can basically create a copy of it. So, for example, I can just do a copy, and then I can come here and do a paste, and I have done that, and I'm calling it orders summarized, but this is my complete data. Now what we will do here is we will basically go ahead and do a grouping by again like what we did earlier based on your shipment based on your segment and based on the sales. So that's what we are looking for. So let's go for the ship mode, and we go for group by, and here you would want to go for advanced to ship mode, and this one I will go for segment. So that's fine. Now we want the new column name. So let's say shipment wise sales. So I want to do a summing, not the counting of rows, and I want to do a summation based on sales like what we did earlier, and then you say okay, and that basically gives you the data here. Now what we have is we have the resultant data based on the data which is coming in from here. We did the same thing just 1 minute back, but we worked on the original data set. So what I did was I created a copy, and now I'm working on this one. So I'll say close and apply. And now we are back to our desktop. So it is applying these changes where we have done some transformations, we have done some grouping by, and what we can do is once we have the data here, we can anytime look at our data sets or tables. So this is my original one. If you see now I have order summarized. I can just pull out this information. I basically have my returns which we have not really touched, and we have the scientists. So we have all the four data sets here. Now what we can also do is let's look into order summarized, and we just have this data here. So this is fine, and you can continue working on this. You can basically merge columns from two different data sets, and then you can get the merged column, and you can rename it. So you can obviously do that. You can basically do an uncheck whenever you're working on these data sets. So what you can do is if you would want to work on transforming, for example, let's go back here and say I want to do some transformation on it. So how did we do it? We just did a transform, and you can go back to transform. So you have this data here, and the data what you have you might be interested in transforming this into something else, and then you don't want to maybe load this data. So you have this option where you are selecting orders and then you have something called as enable load which can be unchecked. So when you do an uncheck, what will happen is whatever changes you perform only those changes related data set will be loaded and they will still be available, but this will not affect your it will not affect your original one. So, for example, let's say copy, and let's go in here. I will do a paste. Let's say orders. Oh, I did a paste. I need to rename this. So let's do a renaming. Let's say orders. And here I will say summarized. And I will say US. So I'm renaming it now. Let that get loaded. We can perform some transformations on it. So I have here where's my country? So let's look for country. Yeah. And let's look for country. So here I will go for only United States. Okay. That's what I'm interested in. And then I can choose well I am interested in just central US. So I can basically go for just the central US, and I can get rid of all of these. So now I should have only central US data, and this is fine, and this is the data might be we are focusing on right now for doing some visualization might be looking at sales might be looking at the product names. So you have the product name. Now remember you don't see any filters here, right? Because the filters are coming from the resultant set and your transformation. So if you have any filters, you would be seeing in the top row. Now this is the data we have. Let's um let's not restrict it to region. Region would then reduce my data, but that's good enough for us. I can just say no, I'm clearing off this filter. I'm still looking at United States, but I want to look at all the regions. Yeah, what we would be interested in category, and that's anyways chosen as technology which we had chosen when we were loading the data. We have copiers and machines, right? And we can basically keep this. Now this is fine. I can apply the changes. I can apply the changes based on this one. And what I can do is I can just say for now apply. So that's going to apply all the changes which you have done in orders or summary or the new one. Right? And what I can do is now I can choose order and I can say don't enable this in load. So it says disabling load will remove the table from the report, and any visuals that use its columns will be broken. We are not creating any visuals as of now. The table will be removed. So that's fine. And now I will say close and apply. So what happens is you are loading the data based on the changes. Okay. Now you have your order summarized. You have returns. You have scientist. But you basically do not have orders anymore. So that was not loaded. So I only have this one. I only have this one. And you have returns, you have scientist, you don't have the orders column. Right now that particular data set was not loaded at all because we did not choose that to be loaded. Right now while I'm in this orders which is let's see here and actually you can drag in. Yeah. So you have order summary, and this has basically kind of data which I'm looking for. So I really don't need the orders table. So you can do it in steps, and you can aggregate this. You can have aggregated data. You can have all the data which is filtered, transformed, grouped by, and then basically just load it, and the original data set which you used that's no more being loaded here. Now at any point of time if I really want, I can go back to transform data, and remember it is still here. It is still here. It's not gone. Right? So you can basically select this, and you can say enable load, and you will have the data back which you can continue working on. Right? So these are some quick transformations which really help us in working on the data. Now obviously if you have data you want to perform some left joints, right joints, you have inner joints, outer joints, so you can always do that; you can take two different data sets; might be I'm interested in taking the orders summarized which talks about standard class consumer shipment wise sales, and here if I look at order summary, I have other details, but the thing is we need to make sure that these These have the values. These have the values. Say, for example, the segment column here and the segment column here can really be used to join these two tables. So if I create a relationship or if I create a join, I can basically merge the data. So this is how you work on data. We will also see some more examples on might be modeling the data using some expressions to work on the data. So we already looked at creating a report, selecting particular fields, and then publishing the report onto your PowerBI service. Now this is the report which we had created which says state, order ID, sales, and then I also added this returned field, and that was basically by creating a relationship between order and returns which we can also have a look in model. So this is the relationship which is created. If you just place your cursor here, it tells me that we have a relationship between order ID of returns and order ID of orders. And that basically allows me to join the data, bring it in my one report. Now this is basically your data sources you can look at, and if you click on your visualization, so that shows you your report. Now what we can also do is we can make it interesting. Now we would not want to scroll through the fields to see wherever or what was the order or what was the order ID which was returned. Now I can do a sorting. I can filter out. What
I can also do is I can use this option which shows slicer here, and that basically allows me to work with this data. So we have this report here, and basically, as I said, you can click in here; it shows the data.
Now what I can do is I would want to filter out information or slice the information using your returned either being yes or having a field which has no value. How do we do that? So basically, I can drag and drop the returned here as a field which comes from returns. Now that basically shows me only the value as yes, but I do know that there is there are some fields which are blank. Now how do I add filter to this? So I can click on this one, and then I can click on slicer. Now once that does so, it basically pulls out all the different values. So you have either yes or you have the blank field for returned. So what we can do is we can select yes. You will see only the orders and their ids and sales where the products were returned. So that gives me 108,118, and I can select blank. So that will basically get me all the orders or products which were not returned.
Now this is a simple way wherein I can add a filter to or a slicer to my report to basically give viewers a choice of uh selecting different fields, and you can add any number of slicers. You can basically say I would want particular kind of information. So, for example, if I go into orders and we know we have the state. Now I do have the state information here, and basically, I can if I would be interested I could filter this out in my report itself. I can sort it. I can look it in a different order. What I can also do is how about bringing in state here and basically dragging it here. So that gives me the state option. It is giving me a visual which is basically giving me a geographic location of all these points. So yes, that can be good.
What I can also do is I can keep this which basically shows me the state map; might be it can be useful. You can zoom in, you can zoom out, you can look at specific information here. You can drag and drop here. So that's fine. What I can also do is I can again take the state and bring it here, and that basically can be instead of my map I can go for slicer. So that gives me all the values here and which basically allows users to choose the fields or the states which you would be interested in looking at. So, for example, if somebody is interested in looking at the data for Georgia, just select this one, and you see the map automatically shows you where in the map that's the place, and it shows me all the sales for Georgia state.
Now I can also basically select yes, and that shows me which were the orders which were basically returned. So that gives me a quick overview of statewise what is the geographical location if the orders were returned, or maybe I can just click on blank, and it shows me the non-returned orders. I can again go here and uncheck the Georgia option, and that shows me all the states. Now once you have done this, this looks like a comprehensive report which can be useful for the viewers for your management team and so on. So we can just do a save, and that basically is saving my report. So I have this report.
Now what if I publish this report? So I can just do a publish, and when I publish it says okay workspace. So let's say select, and then it says replacing this data set may impact two reports. You already have a data set named by this one. View the impact. I would say replace, or I will say view impact. So that basically takes me to the PowerBI service because sometimes we may have some reports which we have already uploaded, and updating an existing report might basically affect my existing report. So it basically shows me the impact analysis. It shows me one workspace. There are two reports. They are they have not been added to dashboard. But these are the ones which will get modified. So let's, for example, as of now go ahead here and let's look into my PowerBI. So go back to your desktop, and I'll say no I don't want to replace. So click on cancel. So I do not want to publish it. What might be what I can do is I can try saving it as a different report. So let's say save as. And now I will basically say additional filters. Okay, let's save it. So now you see the name on the top changes to additional filters, and now it's saved to publish this. And now I can go ahead and publish it. Select your workspace, and basically it says this is the report being published with our additional filters with a map which gives a geographical uh area showing us the information, and then basically what I can do is once it is done I can look into my PowerBI service like we did earlier. You can do a filtering. We can basically query this data. We can share it with other users who might be interested in looking at this particular data. Now this says it is done. So it says get quick insights, and might be it's a good an option to look into what kind of insights it's it gives you. So click on that. See the beauty of PowerBI where it tries to search for any kind of insights which it can gather from the kind of report which you have built.
Now once the insights are ready, it will let you know what we can also do is we can come in here click on view data set. So you see now it shows your additional filters, and here you have option where it should be showing your report. So let's say view, and view is fine. So, and if it doesn't show up sometimes it might taking taking time for refreshing. So you can always go here, and then you can click on your report, and that should get populated. So this is the report. These are the filters which I have gives me an option of choosing all the states and basically allows me to edit the report and look at all the information here. Meanwhile, we can see here it is still trying to gather some insights from the data, and now you see there are some insights here. So it says sales which is coming up, and a subset of your data was analyzed and the following insights were found. So you're looking at sales by ship mode. So it says standard class, second class, first class, and same day. So there were different shipping modes in our data, and that's what it shows me the sales which one had the majority. It shows me the profit. So which city or state had more profit. So New York City has noticeably more profits here. Average by shipping cost by subcategories. So there are these different subcategories which we can look at such as copiers and machines have noticeably more shipping cost; profit by product name. And you can basically look at the row ID and quantity. So this is where you're looking at a regression analysis. You're looking at row ID and quantity. So there is a correlation between row ID and quantity. So these are two different variables or fields which are related. You're looking row ID by category row ID. So it says California has noticeably more row ids. Sales your profit count of region and count of returns. So there is a correlation again between two different variables. Average of shipping cost. Now we would have taken lot of time in building all these visualizations, but PowerBI has already helped you in gathering all these insights, and then you can basically select which one of these is what you are interested in. You can focus and look for more information based on all the fields; it has given you good amount of insights which will help anyone who is looking at this particular report. So that's your quick insights here, and we have this information.
Now once you have this information, this is basically where you have your focus mode. So it says subset of your data was analyzed, following insights were found. You can basically say download and uh here you have other options which allow you to work with your PowerBI. So let's look at this one. So this is where we have our report, and we can continue exploring it more. One more interesting feature which PowerBI has other than having your insights ready to use which is basically in your workspace, and you can basically use these insights. What we are looking at various options here, and basically you have this option where it says spin the visual. If you are interested in a particular insight, you can always pin it which you can always go back and look into. What you can also do is you can also click on edit report here. Now that's a report which has already been published to your PowerBI service not yet shared but that can be shared or that can be subscribed. Now once you click on edit report, it has option of reading view mobile layout. You have basically an option which says basically options for navigating through the data set. You can go for how visuals on the canvas interact with each other. You have all these options, and one of the good options is ask a question. So you can always click on ask a question, and that basically b says some suggestions. Now you can open this, and it says okay ask a question about your data. Try one of these to get started. What is the average sale? Sort orders by order date. Sort orders by product ID. How many ship modes are there? Compare quantity and discount. So do not worry that your report has only four fields. So it has state, order ID, sales and returned with some filters. But what about you looking at how many ship modes are there? So it is already looking at your data. So if you click on this one here and you can see what are the different fields what we have and you have ship date and ship mode. So this is one of the fields which it is showing you to ask a question. Now what you can do is you can say how many ship modes are there. Let's click on that. Let's ask this question. It says four ship modes. And do you want to add this to report? Yes, you can. You can let it be as it is. So you can basically keep this question here. And here you have an option. The visual is showing number of ship modes. When you place your cursor here if you see here turn this Q&A result into a standard visual, and let's do that, and basically it is saying number of ship modes right so now that's the power of your uh BI powerbi which has basically allowed you to ask a question and quickly add a visual to your report; now what we can do is we can basically save this Or you can say save as and give any different name. So maybe I'll just say save because I would want to have this information, and the report is saved. So in this way you can basically not only create smart visuals, you can not only relate different data sources using data models or relationships. You can add maps, you can add filters, you can add quick questions. You can basically just go here and say, for example, you would want to ask a different question. Now we see the fields here. How about looking at the shipping cost? Right? So here I can say um what is the uh highest shipping cost? And that shows me some suggestions. Let's select that. And that shows me the value which is great. And I can keep it as it is. I can basically convert this to a visual. I may want to keep the question because might be this question was asked. And uh you would want to see the result here. Might be you can move this somewhere here. And that gives me some kind of question which was asked, and we can do a save. And that's my report which has been saved in my BI service. The data set is still there. You can basically go ahead and share this.
How to connect different data sources with PowerBI. So in this session today we will see how can you connect different type of data types data sets like Excel, PDF, CSV etc. to import in PowerBI for your data visualization needs. So what's in it for us today? We will be learning how to connect to data different data types, data files like Excel, PDF. Then what are the different data importing modes, and then I will also show you practically different sets how to import them in PowerBI and use it for your visualization purpose.
Now what are the steps to connect to data? So now we will go directly into PowerBI and try to import one by one few most commonly and popularly used data sets which are most commonly used uh in a day-to-day activity. REST of course there are PowerBI supports any number of data sources uh but we will do something practical on the most popular ones. So let's let's open our PowerBI. Now this is my PowerBI, and first I want to show you that how can I import data directly from a web page and import the data. Now it is asking for a URL in order to import data. So what I have done is I have created a Google Excel sheet with simple data with rows and columns, and what I have done is I have shared this uh sheet as publish to web. Okay. So you just need to say publish to the web the link as web page and say done. It's it's automatically published and say link. So copy the link which you have published on the web. Copy this link and then go back to your Tableau. Paste it link over here and click okay. Now PowerBI will try to establish a connection with this Google doc sheet because it's published on the web. You need to wait for a while while it is reading. Okay, now it has read one of the HTML tables. So I'll select this one. Now you can see it has it is showing me a preview of the table which is there on my Google sheet, right? It has 11 rows. So it has all showed all the 11 rows. So now I can go and transform this data because I can see my headers are there starting from the second row. So there's an opportunity for me to transform the data. So I'll go and transform it so that it looks clean. Okay. So first is I need to remove the first row which is the null row. Remove the top rows. Okay. And then I need to use the first row now as a header. So you just click this option use first row as headers. That's it. So now if you see my row ID, order ID, order date, ship date, all my data is now ready. So I can say close and apply. Click apply changes. Now this is an example of web data import. You can go and preview your data right now. Uh the biggest advantage of this data connection is that it's a live data. So, for example, I insert another row. Let me change the order ID. Some some I've changed some basic stuff, and I it's autos saved. Control S. Now I'll go to my tableau and I'll refresh. Now you can see as I refreshed my power query editor, I clicked refresh all, and I got my new row which is there in the live data. I got that fetched from my Okay, I got that row the row row ID number 12. So I I have to say close and apply. Now you can see the new row, the row number 12 is now available in my new data set in the data set because it's a live connection. It's a live connection with the webbased Google sheet. Okay. So this is one important way in which you can import data. Now let's try to import data from a text file. Now I have already prepared a text file called subcategories.txt. Now let me just open it in a notepad. Now it's a very plain simple file tab separated file in which you have product subcategory ID, subcategory name and product category key. So basically to which product category this particular subproduct belongs to. Right? So what I'm going to do is I'm going to go back to my get data option and I'm going to select text/ CSV option and I'm going to select option mod product subcategories.txt. Okay. So now PowerBI has identified that it's a tab delimited file. It has recognized the headers etc. Right? And I can now directly load this file. Okay. So now once the data is imported in PowerBI, it is like irrelevant to me. It's a composite data in import right. So in my presentation when I'm talking about importing data there are different importing modes, right? Import data import can happen through different ways. Okay. One is direct query mode in which I create a live uh connection to the database which I'll also show you uh using MySQL and MS SQL server and also you can do a composite mode in which you can have data imported from Excel plus you can have direct query modes so you can have multiple uh modes to connect and create a composite data model and that's what we are doing right now in our practical. So what we are doing over here is one we have imported data from the web. Second we have imported data from a text table. Now after doing text now our next task is to import from CSV. Let's try another one. So now I have imported product subcategory. Now I'll import a CSV file. So again I'll choose the option text/ CSV. And now in this CSV file, let me open this CSV file and show you what in is it. So this is a list of all my products. Product key, product subcategory key, product uh stock keeping unit etc. A simple CSV file and I'm going to import that. Okay. So now it has identified the delimiter is comma rather than a tab, and it has already recognized the headers correctly. So I'll load it. Okay. So now my products are there, product subcategories are there for product categories. Now what I have done is I have created an Excel mode now. So now Excel I'm using to import my product category. So now I have to click on the option of import data from Excel and I'll say product categories. Select the sheet. Load. And now so my products product categories product subcategories do with different uh uh data storage types but still now the data is imported into PowerBI it is a composite data model. Now another very important data type which you can import is the PDF also right. So what I have done is I have created a PDF called customers. My customers data is lying in a PDF. So what I've done is I've created a PDF which has data for some columns are there like you know customer key, prefix, first name, last name, birth date, marital status, gender, email address, annual income, total children etc etc. So this is the data set which I have created in PDF. So what I'm going to do is I'm going to select PDF now and import customers PDF. And see it has recognized my table on page one which I'm going to load. Okay. You can rename this as PDF table. So this basically these are the different type of data types we have imported PDF, Excel, text, CSV and web page. Now let's take a look at another interesting data set which we want to import is the MySQL server data set. So what I have done is I've already installed MySQL server on my local instance and there's already a schema of SQL live tutorial over there and I have certain tables already prepared over there like department employee etc. So my goal is now to import this data or create a live connection with this data set. Now in order to import my SQL database connection in PowerBI you need to first download a connector MySQL PowerBI connector. So you need to go to this link and then click on download and install the MySQL connector based on the operating system you have. and click on download and install it. After you have done this, go back to PowerBI and then give the IP address of the database. In my case, it's there in this local machine and the schema which I want to import is SQL live tutorial. So, I'll give the name. Click connect. Okay, now it's connected. So now it is asking me which particular tables you want to create a connection with. I'm choosing department and employee and I'm just loading them. Okay. So now this is the exact data which is there in the employee and department in my SQL. Okay. So this is one example of how to create connectivity between PowerBI and MySQL. Now I want to do the same thing using SQL Server, Microsoft SQL Server. So I have also installed Microsoft SQL Server on my machine and I have used the SQL Express. So this is the name of my server. So which I'll copy the server name and go to get data. Select SQL server and
For now, database is optional. I can say direct query. Click okay. Okay.
Now it is showing me what all tables I can import. So in my SQL server tutorial, in my SQL server, I have I have these three tables: customers, employee attrition, Olympic events. So I can use probably the customers one, which is Now you can see this is the data, the customer's data which is lying in my SQL server. Okay. So I can preview it and load it. So now you can you can preview the data in uh PowerBI; that this this is the data. So I can rename it as customers from MSSQL, and this is from my SQL, and okay.
So now this is not the only uh data sets you can import. Now, if you take a look at the options which PowerBI gave of what different type and variations of data it can it has compatibility to import from. Okay. So we can just take a look at the categorization on the left-hand side first. There are file-based like Excel, text, XML; JSON is also possible. You can evenly directly import an entire folder, and within the folder whatever uh data types of files are there, it'll detect it. PDF, park key, or even SharePoint folder, which is itself a Microsoft uh technology.
Then different kind of databases: SQL server and MySQL we just saw, but it's not only limited to this. You can connect to Microsoft Access, SSAS, Oracle database, IBM DB2, Postgress, uh, Caiase, Terodata, and then SAP uh, uh, databases, Amazon Red Shift, Impala, Vertica, Snowflake, and any number of databases which are there in the market today uh, Amazon, etc. Then it also allows you to connect with its own Power platforms: PowerBI platforms, data mods, PowerBI data flows, data vers, etc. Azure; there are different kind of storage uh mechanisms in Azure, and Azure itself is a Microsoft technology. So it has a compatibility with a lot of Azure uh based data storages like Azure SQL database, blob storage, uh Azure data bricks, right? Azour HD inside Spark. So if you have those kind of services running on your Azour cloud services, you can even import them over here.
Now online services like, you know, you have ERPs running uh or some data which is shared on the internet. If you want to import it, uh that is also possible through certain products. Uh Dynamics 365, Microsoft Exchange online, Salesforce, Google Analytics, Adobe Analytics, GitHub, uh LinkedIn sales. If you want to do some analysis of some social networking, uh you know, feeds, that also you can import. Then other miscellaneous are also there: web-based, hive, R script, Python script. If there's something to import, get data from uh Google sheets like we saw one example in our video right now. So there are multiple options available.
Now, once you have imported the data which is relevant to you, in our subsequent sessions we will see how to create relationships, but just giving you a glimpse that whatever data you are importing, PowerBI auto-detects certain relationships and it'll create for you, but then you can go and manually also change. So this is the composite data model which is getting created in the back end while you are importing the data. You can easily go and manage these relationships; either keep them as is, you can delete and create new ones manually. So there is no limitation in that.
So this is what we have witnessed. We have imported data from different files types, data types, and then you know we have tried to once it is imported into uh PowerBI, then there is no limitation of how you use it. You can create visualizations across different data sets and then create your standard reports. So this is the example of importing data from the web, importing data from a database, from a PDF, and then once you have data you can shape and combine data; you can basically do what whatever transformation you want to do, you want to uh make joins, merge the data.
So, for example, if we go back to our PowerBI and if I go back to my transform data section. Now as I have now different data sets available with me, I have I can do any kind of u you know operation transformation on the data, right? Uh so like I showed you, I uh upgraded the header row because one of the imported data was not showing the header correctly. uh or this columns like this exact one column is extra. I can remove the column. Right? All those transformations, whatever I do in the back end gets captured in the applied steps section. Right? This is the customer data. You can create uh you can merge it. You can append it uh you know with other data sets. Right? Let's for example I want to create a merge data set of my categories and subcategories. So I can say merge, select the two data sets and say merge queries as new, and I can select product categories and product subcategories. Select product category key on both the sides and then they do a left auto join. So whatever product categories are there, I'll get the subcategories associated with it, and I'll create a new table which will have now I have the table which has the category and the subcategory and subcategory in one table itself. So I can rename it now to as category subcategory table. It's a it's a merge; basically it's a join between category and subcategory, and now I have a common table right, and I can close and apply. So imagine I have created a new table which is imported, created from one data set is which is excel-based and another data set which is text-based. See this category subcategory table. So now I can use it the way I want in my visualization reports.
So that's what the presentation says right, that once you have uh the imported data you can shape, you can combine, you can adjust, you can do whatever transformation you want to do and create your visualization data modeling in PowerBI. Now today we will discuss how to create relationships and different kind of data models within PowerBI based on the structure of data you're importing. Okay.
So what topics we are going to cover today? We are going to talk about different types of data modeling, and the most important part and aspect of data modeling is the cardinality. The cardinality which you basically decide after reviewing the nature of data and after you've imported it, what kind of cardinality you have to basically highlight, right? And there are different types of cardinalities which you might have heard earlier also if you are from PL/SQL background, like one is to one, one is to many, etc. We will we will talk about that now. What are the different types of data modeling? Now, dimensional data modeling is one of the most popular and most uh you know widely used uh modeling. In dimensional data modeling, you have master data uh like for example customer data, date, store data, product data. So these are like you know uh less frequently changing data sets. So there is an organization right, and you have a set of customers, their email id, phone numbers, etc. that will change less frequently as compared to the sales transactions because transactions are happening every day, every minute. So sales is a more fast-changing data set. In dimensional modeling, which is in the terminology of data uh is also called as a fact, and customer, store, product which are like more of static data and not less changeable data is sometimes called a dimension. So this is a typical dimensional data model which is typically used uh sometimes right, and then there is another model which is relational model. This is a typical model which we have been using in database design like you know primary key foreign key relationships. So for example, you have a customer who has purchased a product. So probably he might have the customer might have the details of the product which he has purchased, and you will make a join between customer and product table, and even uh you can make a join between product or product type or customer or product type. Customer table will also have a key to the product type. So this is less uh conducive for reporting, but it is more of a transactional uh relational model, but of course, this is also feasible. But from the PowerBI perspective, when we talk about reporting and visualization, this is the most extensively used dimensional data model, and this is what we are going to see in our example now.
So what I'm going to do is I'm going to show you certain data sets. First, we will prepare and create certain of our uh data sets and then we will import in our sample PowerBI file and then slowly slowly we will create the relationships. Now one important thing which you need to understand that in PowerBI if you go to PowerBI, there is an option that that PowerBI auto-detects new relationships after data is loaded and import relations from the data source on first load. So for example, if you are importing the data from a database where you have already defined the primary keys and the foreign key relationships. So uh that is the first option which PowerBI will auto-detect. And secondly, if suppose you are importing two different kinds of data sets, one is Excel, one is CSV. And if PowerBI detects a common column, key columns, it will auto-detect a relationship which you can go and later change, modify, manage in your relationship uh menu, manage relationship menu in PowerBI, which I'm going to show you. Okay.
So if I open up PowerBI and this is where the option lies. Go to file, go to options and setting options, data load, and these are the two options which are by default checked. You can uncheck it and auto and manually prepare relationships. There's no limitation to that. But if you keep it checked then PowerBI will do its job to detect the relationships. Okay.
Now coming to the next important factor, cardinality. Now before I start playing around with my data and start showing you certain relationships, it's very important to understand these four types of cardinalities. One is many to one. Right? So basically many to one means that many orders contain data of one customer. So per order, one customer is there. So from customer to order or product or delivery address, it's a one-to-many relationship. And from the other side, from order to customer perspective, it's a many-to-one relationship. Okay.
Second other uh cardinality is one is to one. 1 is to 1 relationship is only applicable when you are saying is it's an extension of the current table. So for example, in one table you have employee details, and you are extending the details of the employee in another table like employee address, employee ID. So that is like one is to one; there's no multiple records of a single employee in the address table; only one employee ID exists. Right? Now one is to many as I said is the reverse side of many is to one. It's in customer table; only one customer record exists per customer, and one customer can place many orders for multiple products and can also have multiple delivery addresses. So that way this is a typical one is to many relationship. We will be seeing this example also in our sample data set. And last is the many-to-many relationship. Now many to many is a very typical example. So which I'm going to show you practically, and in our case, we will see that like for example you have placed an order for a particular product uh you know but there are multiple fulfillments which has happened. So suppose you made an order for 10 products, but at the back end when the company is fulfilling it is first fulfilling the first two products then the rest three. So basically you the fulfillment is happening in batches. So one order ID might have a multiple fulfillments for the same order ID. So there will be a many-to-many relationship which I'll show you practically.
So now with this background, let's start importing our data. Now the first important thing which we need to import is the master data. So first I'll import all my master dimensions which are uh which I'm going to you know use in my example. So first is the customers table, customers data. So this is the customer details like customer key, prefix, first name, last name, birth date, marital status, and gender. Some redundant columns are also present, but we'll remove it. So my customer data is loaded. Now today's session is all about this section of modeling. So we will keep our focus over here. Okay. Now some columns, probably some blank columns are there. I can select them and say delete from model. Yes. Okay. So now this is my customer's data with the relevant columns and the key per customer key. Now there's no relationship in this model right now, right? Because only a single table is there and the associate data is only imported. Now let me also import my another important master table is the products. Select the product data, product key, product subcategory, product SKU, product name, model name, product description, color, size. So just see all the relevant information only specific to the product is available. So I'll import it. Okay. Now see there's no relationship between product and customers directly because until unless a customer makes an order, places an order for a particular product, there is no join right. So now between these two tables, the most important now another table which will now make sense is the sales order table. Sales table. Now I am assuming that PowerBI has auto-detected the relationship. Now you can see that because I've already uh ticked that check box. Now let's see what PowerBI what relations PowerBI has auto-detected. Let's first check the relation between customer and sales. I'll double click this uh join. Now what it has done is it has created a join of many to one between sales and customer. So what does that mean is that one customer has can place many orders right, and that is that it has detected by the quality of the data and the data sampling which PowerBI has done. You can also reverse this relationship; here I can select customers and I can select sales. Now it has become one to many, so that you can also do manually, so that is what I said whatever PowerBI is detected. It is up to the discretion of PowerBI internal configuration and algorithm, but you can go and change it. So this is now you can this is by default active. So we want to keep it active. One customer many sales orders; cross-filter direction means that only from customers to sales is the filter applicable, not reverse. I'll come to this with my another example, but first let's change the relationship. So one is to many means from one customer and many sales orders. Similarly, let's see what has happened at the product side of the relationship. Similarly, PowerBI many sales orders for one product; you can for simplicity sake you can say products sales product key is the join. Now just focus one more thing please. Uh also see the the column on which the join is is the grayed-out column. Product key is also here, and product key is also there, and it is what we wanted. So one is to many relationship from product to sales table and active. Now looks fine. This is something which is looking logical, and probably now we can proceed further to create a report. Now let me explain the cross-filtering with an example. Now for example, I want to check in a report that what is the count of products which uh which a particular customer has ordered. Okay. So what I'll do is I'll select the product count or product name. Now if you see the for each customer in front of each customer name the count is coming as 293 293; it is getting repetitive because because there is a one-way filter direction filter between customers and sales and sales and products right, so this join is single-sided; it means that from customer to product you can't find a relationship because it's a single-side cross filter right; what does this if I change it to both it means that it is equal to a join between product and sales and every product detail now is appended to the sales table; so if I want to make you visualize this you need to go here; I'll first open my sales table; we can also open it here. Let's make click is okay. Now if I click okay, you can see the single arrow is changed to a double arrow. It means it's a it's a both-side filter. So when you say a both-side filter, it means that implicitly within PowerBI, you can imagine that all the product columns now will get appended because of both ways filter you have applied. And if you go to your report now, see the change of the numbers now 40 20. So the total count of products across all my customers comes out to be 293. Now the report looks uh correct. If I change the relationship from back to single between product and sales, then you can't make a join between customers and product. Basically, you can't derive the product count from the product table. See this; if you have to live with it, then you would have to go to the sales table, get the product key, and get the value of count of product key, but that is not correct. Okay. So if you want a report in which you want the count of product name and even if you want a count of distinct product name. So this will not come correctly. You would have to go and change the direction of the filter which is from single to both. So this is a typical example there where you want to use a two-directional filter. Now let's proceed further and import other data sets in order to give show you another example. Now I want to show you an example of 1 is to 1. So I have another table which is called customer details. So the key in this table is again customer key, but only email address, annual income, total children, education level, etc. Other details of the customer is there. So I'm loading the customer details. Now you see it has auto-detected a 1 is to 1 relationship. But what is the meaning of 1 is to 1 means one customer key only has one entry in customer details. There is no multiple entry. So if you click this button, it's a one is to one, and the cross filter can be both or single doesn't matter because one customer will have only one value. You can make this as active. Okay. And if you go to the customer report table, you can now easily associate an email address with the first name. You will get one is to one record. So now you can see that with one is to one relationship with the first name I have associated the email ID, and for each email ID there is an associated first name with that. So this is an example of a one-to-one relationship. So in this example, what we have explained is that for each customer there is an associated customer detail right. Uh so you have the first name, email address, education level, homeowner, occupation, and total children count. So in this report what we have done is uh if you click over here so the first name and the email address. Okay. So there's a one-to-one relationship, and then and if you drag the customer key uh report takes time to render and even if you can. So this is the reporting output. You have the customer key, first name, associated email address, and the count of product names uh which the customer has ordered. Now this is an example of one to one. Now I want to show you an example of many to many. Now for that I'll import my fulfillment data set. Okay. Now in my fulfillment data set there is a column for order number. So basically what I'll do is I'll drag order number from here to here. Okay. So now what has um uh PowerBI detected? I'll do one thing. I'll select sales over here, fulfillment over here, and order number to order number. Okay. So, it's a many-to-many relationship. So, it means that per order I have created multiple batches to fulfill that particular order. Now, a many-to-many relationship is a definitely a candidate for both ways cross filter detection uh direction. But you can you can check that. But definitely uh PowerBI shows a warning that this relationship has cardinality to many to many, and this should only be used if it is expected that neither column contains unique values. Okay. So we know that fact; that's why we are accepting this relationship as many to many because we know there are multiple order numbers over here in the sales table which are mapped to the multiple order numbers in the fulfillment table. We'll click okay. Now you want to keep uh the uh direction as both ways or one direction; that is up to you, the way you want to uh map the report. So I can double click over here and you can even click. So now you can select from which way single filter you want from fulfillment to sales or sales to fulfillment. I'll prefer sales to fulfillment and click okay. Okay. Now we have our all our different kinds of relationships over here which we have tried to shortlist: one to many, many to one, one to one which is uh this example, and many to many. Now if I show
You further relationships which you can keep on adding, like, for example, I have uh uh the example of territories. Now, in which particular territory the sales was done? So I can map it over here. Okay. So now it's a typical one-to-many relationship because territory is my master table, uh where I have a static list of continent, country, region, and it is mapped to the uh territories which are for in which my orders have been placed. So it's a typical one-to-many. So that way, you know, you can keep on adding data. Then you have uh details of returns. Now, this is another transactional table which is about the orders which have been returned rather than being, you know, returned by the customers. So you have a product key, and so automatically PowerBI has detected a relationship between the product key and the product uh table. Right? And even if you can join the territory key in which territory the return has happened. Right? So mostly the most common relationship which you will observe is the one-to-many because, as I told earlier, the most common relational model is the dimensional model. Uh the static data, the slow changing dimensions, the SCD's are the master tables, and the most frequent changing are the fact tables. So if I talk about a typical dimensional model, the fulfillment table, sales table, and the territories table, sorry, uh the fulfillment table, sales table, and my returns table are the fact tables of my data model.
So what exactly you mean by data transformation in PowerBI? So data transformation can be a little similar to data cleaning. So before any kind of data analytics, you might be receiving raw data from a website source, a SQL database, or an Excel file, or multiple sources, right? Once after you receive the data, whether it is batch mode data or streaming data, you are supposed to clean it, right? You might have to clean up the discrepancies like the blank rows or the blank cells or any irregularities in data such as wrong data type, right? Such discrepancies from the data should be eliminated in the first stage of data analytics. So that's exactly where data cleaning and the data transformation comes into the picture. So you have various tools for data cleaning and data transformation like Excel, SQL. But if you are a PowerBI user, then good news for you, Power Query and PowerBI can assist you in terms of data transformations. So in this tutorial, we will be discussing the fundamental, the most important day-to-day data transformations which a data analyst takes care of in the process of data analysis is what we going to discuss today. So let's quickly switch to PowerBI. But before that, let's have a overview of what kind of data we are exactly dealing with today. So we are dealing with superstore data, and that's in Excel format. So this is our superstore data set, and we have four tabs here. The first one is orders tab where we have customer ID, order ID, date, ship date, ship mode, and customer name. And in the second tab, we have stores data set which has the details about the customer from where he or she is, the state, city, postal code, and which category or subcategory did they purchase and order sales, discount, profit, everything, right? And here we have some information about any of the orders which were returned and some people over here. So these are the four tabs that we are dealing with today.
Now that we have an overview on the data that we're dealing with, let's quickly now switch to PowerBI. So now we are on the PowerBI window, just got changes. There you go. Let's quickly import the data from our downloads. This this is the data set that we want to deal with today. Now, it might take a little while to connect to that particular data set and load the data onto PowerBI. Just a couple of minutes since the data set is a little too heavy. It's about 10,000 rows. So, let's wait. Shouldn't take long. There you go. The data got successfully loaded. So you have the option of loading what kind of data you want. You have four tabs as we just discussed. You can load the orders tab, and you can load the stores tab. And in case if you want the returns tab, you can also load that. And if you want all of those, just load all of those. Right now, I just want the two tabs, orders and stores. Now here I can just directly load to get started working on this. But in case I don't want any kind of discrepancies, in case if I have a doubt that this data might not be cleaned, I shall go with data transformation. So ideally, you should go with data transformation. Check your data first before any kind of analytical processes. So let's go with that transform data. And shortly we should be having the power query window open on our desktop screens. So there you go. You can see the completed data set has been successfully approved, both the stores and orders data sets. Now uh let's quickly check the data from our data set. So here you can see we have orders date, right? But I can see 42 682 and 4253, this is not in the form of date, correct? So this is the simple uh uh step that we discussed, changing the wrong data type. So you can just click on the lower arrow button over here and uh or you can right click, and here you have an option to change the type. Correct. So it is considering it as a whole number, which is wrong. So you can change it to date current. So now we are trying to change the order date from a data type of code number to date data type. So there is some error. If you click on error or if you just navigate on to it, PowerBI should be able to show you what error was it, and just in case if it's not working. Okay, we are unable to parse the value provided. So you can just remove that and try it in a different way. Change type to date and time zone, date. I think this should be helpful. Or if it's not working here, let's quickly check what could be the error. Take time. And now let's try to refresh the data. It is taking a little while. Uh we also have another information that we deal with. We have the first row as row headers. So we should be declaring PowerBI that we also have a row header over here. It's taking a little while to refresh. Meanwhile, let's quickly check into the stores data. And here we have customer name. So let's try to apply second type data transformation which will be like, let's say, split column. We have uh the complete name of u the customer. Let's try to split it into first name and second name. So by delimiter, and we can give multiple options over here. Left most delimiter. Say a person has three uh parts of his name, first name, middle name, and second name or the last name. So but we just wanted to split into first and second name. So we would go with the first left mostly del limiter and split the data set. Press okay. And it should help us to split the data. Let's name and second name. And we can also name the columns separately as first name and second name instead of customer name. It's taking a little while than the ideal time, but it's completely all right since considering the 10,000 rows of stores data and 10,000 rows of orders data, it is all right. Not a problem. Now, let's try to take a look at the orders data set if it has successfully changed it. No, it is still showing as an error. It move here maybe incomplete. Let's quickly refresh all instead preview and check if can it can help us. So there you go, after refreshing the first order date is changed to date data type. So what we missed is when you change the type you're supposed to add a step. So what exactly I mean by that? Now we are trying to change the second one as well. So just wait for a while and it will give us a choice if we want to add new step or not. That's when we select the option yes, please add a new step. So what do I mean by steps? So applied steps, you can see something over here, right? So every alteration, every change or every modification that you're doing, every transformation you're including onto your data will be recorded as a macro. So that can be implemented if you are loading a similar data set for the next batch. Let's say this is 2022 data, and if you're trying to analyze the 2023 data and every column is similar, and you can just follow these applied steps, and the same implementation will be automated. You don't have to spend time and doing the same process once again. There you go. So, uh this time it has recorded this step, and it automatically take has taken a new step over here. Change type step one. Change type step two. If you don't want the step to be added, you can just select the red X mark over here. It will remove it. And similarly, when you when you go back to the stores data set here, you have the first name and second name split successfully. And uh now uh let's say you want to have unique uh customer data, right? In that scenario, you can just even remove duplicates from this particular column. Just remove duplicates, and you'll just have unique uh data. It's possible that one customer might have uh come here to buy the same uh pro, you know, buy the same product from different dates, or one customer might have uh done a repeated purchase. So it's possible, but again if in case if you just wanted to know if there is a way to eliminate duplicate entries then you can do that. So for now, let's not delete the customer ids here because one customer might have visited the same store multiple times and uh might have purchased a different uh product or might have uh made the same order with multiple products. Right? So there is a possibility for that. Let's not disturb the data set. So I just wanted you to know if there is a way to eliminate the duplication of the data set. Yes, it is. Now let's also check another possibility of data transformation. So let's say you wanted to add a new column and identify or include some mathematical operations. For now, let's say I have sales, quantity, discount, and profit. But I don't know what's the rate, right? So here the sale is for $261 and quantity is two. But I don't know what's the rate of one product. So I can include that. You can just select the last column or where you want a new column. Just go to the add new column here, and here you can just uh choose the custom column should be somewhere over here. Yeah, this is the custom column. And now if you click on the custom column, you can rename the custom column to rate of product, and here you can choose the mathematical operations to be applied on the columns. So sales column insert or double click divided by quantity. Okay. Now it should give you the rate of each product, individual product. It is taking some sizable time. It shouldn't take so long. So there you go. You have the rate of product. And now let's say you want to combine multiple data sets. For example, here I have stores data set, but my stores data set doesn't have any data related to orders, and orders does not have any data related to customers. Now I want to combine these two. Is there a way? Yes, you can do that. Now let's get back to stores, and here go to home option, and here you have something called merge queries. So now the stores data set has been selected in the first data set. Here just select the drop-down and select the second data type which is orders. So here you can see stores with the current one which is in the first place. Now select based on which primary key you want to combine both. So I want to go with customer ID because both of my data sets do have customer ids. So I'll go with customer ID, and uh both data sets will be combined at the end, at the last column. PowerBI will show me a new table, not a new column. It will give me a table combined with all the columns in one column. You just have to expand the column and select which columns from the second data set you want to include in your overall data set. So let's do that practically. So here you can see I just have tables. If I select the expand column option over here, you can see I have a lot of uh columns here. So just deselect everything. I do have row ID. I do have a customer ID. What I need is order ID, order date, ship date, shipment mode, and customer name. I do have it. So that's all I need. So just press on okay, and I should have them included in my new data set all together. It might take a little while. So there you go. We have the new orders ID, order date, ship date, and ship mode added to our data set. Now just click on close and apply. And your data set is all ready for data analysis. Supply changes, but is taking a little time. So at the end, you just have to click on the apply changes, and your data will be ready for analysis. So that's exactly how you can perform data transformation in PowerBI desktop version. So there you go. The data set got successfully loaded all over here, and you can just drag and drop them onto the visualizations part, and you can work on your data. Yes.
So now the PowerBI visuals are on the screen. You can see we have file, home, and add data to your report, visualizations, filters, data, etc. Right? For now, I think we don't have any data. We can quickly import the data onto this particular platform and start our analysis. But before we get started with that, everybody knows there are simple tricks to create all the type of visualizations. Right? If you expand if I if I could expand my screen here, you can have all these visuals. And let's say if I just double click here and if I want any type of vision like it'll just throw me the vision, right? Let's say I want a bar graph for the sales happening in all the regions. So I'll just double click, I'll tap it down, give me a bar graph for sales, right? It will give you, and just in case if you wanted the pie chart for the country wise, you can just give country wise sales pie chart, right? But now let me tell you a few things, correct? So if you are using a pie chart and if you are dealing with, let's say, a lot of companies or I mean countries, a lot of countries like 20 countries or 25 countries, right? In that scenario, pie chart look a little cluttered, right? And let's say you wanted to find out the sales that are happening in the region wise, and you asked PowerBI to create a line graph for that, that would not give you the proper visual, that will not give you the proper visual visualization to be honest. Right? So as a beginner, if you are learning PowerBI, the most fundamental thing is not just understanding how the tools in the PowerBI work, what kind of visualizations you have. The most critical thing that you will need to know after understanding the basics is what type of chart is to be used for what kind of visualization. Right? So that's exactly we are going to discuss today. What kind of data requires what kind of visualization? Let's say I'm working with date data type. Let's say I'm working with sales data type. Let's say there is a requirement where I need to present the data in form of table or a card. Then what are those scenarios, and if I want to use the pie chart or bar graph, then what kind of data types that I need to deal with? What are the situation where I need to use the bar graph and where I shouldn't, right? A few basic fundamentals that we will be dealing with today, so we have uh a wide variety of bar graphs in the first row and a wide variety of line graphs in the second row which deal with the line graph, area graph, ribbons, etc., and in this third row we have waterfall, funnel, scatter plot, pie chart, donut chart, tree map, and next we have map and right field map, and we have uh the gauge cards and everything, right? And here we also have a KPI, right? So we'll also go through a KPI uh type of chart, and if you want to learn about the KPIs exclusively, then we have the KPI tutorial in PowerBI lined up in this particular series, so you can also go through that, and after that we have some slicers, and we have tables, and we have matrix, right? So a wide variety of charts available, correct? So we will try to understand the major ones. The first row, bar graph, which are the scenarios where you need to use the bar graphs. Next row, we have the line, right? Line, area. So all these come under one uh kind of uh set that are similar to another. So which is a scenario where you can use a line graph, which is a scenario where you can use a waterfall or a funnel chart, which is a scenario where you can use a scatter plot, which is a scenario where you can use a pie chart. Right? A a wide variety of uh probabilities, a wide variety of permutations and combinations. So what are the exact needs? What are the exact visualizations that carry a value, that carry a meaning to the stakeholder, which are those particular charts which explain the numbers in the right way possible? So that's the point of today's discussion. So to begin with, let's import the data first from the Excel document. So we will be using the Excel data over here. Just click okay. Now you have a wide variety of tables which are present in that particular workbook. We are dealing with the data tab. So just click on it, select and load. If there are any mistakes or if there are any discrepancies, PowerBI will let you know, and it will also it has the caliber to also fix those particular data rows. Right? So there is one or seven errors right now. You can choose to close. But the overall tutorial is about learning the type of visualization. Right? So seven rows out of 10,000 will not make a huge difference for us right now because we are trying to just understand the basic understanding of what type of charts to use. So I'll just quickly close this. But in case if you want to fix, you can just click on this view errors, and the power query will open up in the background. You can just switch to the power query tab and fix the data rows where they really need to be fixed. Right? So let me close it for now. And now in a short notice you can see we have the data loaded here. Now we have two types. But if you let me let us imagine that you are on Tableau, and on Tableau you have two things, dimensions and measures, right? So measures is self-explanatory. Anything that deals with numbers is called as measure, and anything that deals with characters or names or anything such which is not a number is considered as a dimension. Right? So here we have category, city, country, customer ID. So these are the ones which can be considered as dimensions, and where you have a summation logo or a mathematical symbol right in front of it can be considered as a measure. Right? Now let's say we wanted to create the month-on-month sales report, correct? Which deals with the data type. So just uh date data type, right? Just remember whenever date is included in your parameters, either you are adding it to the rows or columns, just make sure that you are using the line chart which is over here. So let's quickly rename our page to line charts or graphs. Correct? Now we have named that. Now you can either choose to double click and add that. And then here you have x-axis and y-axis. Or you know you can just drag the audit date, expand this order date and the hierarchies over here. So if you want to go with the month on month, you can simply add this to x-axis, and you can have your sales data somewhere over here. Drag this to y-axis. This is one way of creating it. But in case if you don't want to waste time in this particular huge uh process, you can just choose to simply double click on the canvas and write it over here. Line chart sales month. Just click, and there you go. Right. Brilliant. Now, if you choose to spotlight or you can just expand this, right? And if you choose the spotlight, you can see a vertical line showing you the numbers. Correct? We start from January and all the way to December, right? And here you have the month-on-month sales. So remember whenever the date data type is included in one of your parameters, then the best way to
Represent the best way to visualize the reports will be the line graph. Right?
With that, let's switch to the next one. Now, since we were supposed to discuss the bar graphs first, but let's—it's it's okay, not a problem. So let's discuss the bar charts now. Let us know the data set first. So we have sales, profit, discount numbers, etc. Right? And we have region-wise, city-wise, category-wise, country-wise. So let's go with category. Now let's go with category and try to build a bar graph. Just double click anywhere and category. Okay. Bar graph. Okay. If not category, you can also choose to have subcategory. Okay. G R A P H. Just take care of your spellings. I think I missed an R over here. Bar graph subcategory. Enter sales. There you go. So, you have your chart right here. If you just expand it, you can see we have a wide variety of subcategories. And PowerBI was kind enough for us to, you know, sort the data in form of highest uh um ticket price or highest selling product in the first place and the lowest selling product in the last place. So this is how the bar graphs work. But just in case, if you—you can tell me why couldn't we go with a, let's say, pie chart, right? Let us also check there. If I just click on this, what happens? You can see a lot of cluttered data, right? You have a lot of subcategories here, more than maybe 10, right? So, in this scenario, the visuals are a little displeasing, and you don't have the accurate value over here. Just undo it, and you have the bar graph, which is a a little clearer to look at, a little more, you know, decent to understand what's happening. And you can just focus on the top five over here, and you can understand what's going on. Right now you can just rename them as, and you can choose to go with any kind of bar graph, vertical or horizontal, or in case if you have a few more. Let's say we go with the category first, and under the category you have subcategory, then you can also go with that, and you have an overlapping type of graphs over here, stacked bar graphs, which can show you in that particular category which was the product which was highest selling. Right now you can also add that—where is the category? Right, you can just choose that. Okay. So I think we can open a new tab and okay, so we have the bar graph. Next we have waterfall. So let's open a, and let's name this waterfall. So waterfall is uh something which performs of that particular uh property or that particular entity. Let's say I wanted to find out the year-on-year or day-wise performance of that particular subcategory; in those scenarios, I can go with waterfall. So just simply double click and ask PowerBI to create a waterfall model, waterfall chart. Enter space sale. There you go. So it's giving you the period-over-period sales report of subcategories, and the green line indicates that it is slowly growing in terms of sales and sub, and the the red one shows the decline in sales, which is not happening anywhere, and this is the total, the overall, you know, the overall subcategories. So it'll give you a waterfall model, and the overall total of that particular uh segment is this much.
And now we have dealt with subcategory uh waterfall model, and let's try to create a ribbon chart. So ribbon chart and the area chart, those are similar to one another, stacked area and ribbon chart. So ribbon chart will give you the performance of that particular product in the uh timely—if you want to see the performance of that particular product in measured in terms of time, let's say uh month-on-month, quarter-on-quarter, year-on-year, day-by-day—that can be done using the ribbon chart, similar to the line chart, but anyways, let's take a look. I'll name it as ribbon and uh just double click the PowerBI canvas, ribbon chart or just ribbon, subcategory, enter sale. There you go. If you write order month, you can also track the monthly performance of those products, right? You can see a steady decline, you can see a steady upline. And uh so here you can see the months, and here you can see the different colors of months. Different colors represent the months. So here are the products, and based on the products, how's the monthly performance, right? Is it declining or is it u increasing? Can or find it out—you can basically find out that—and uh moving ahead we will deal with u scatter plot, right? So first we dealt with the bar graphs. Next we dealt with the line graphs, and now we also dealt with waterfall funnel, which is something similar. Next we have stacked chart, scatter plot chart. Right now scatter plot is a little different. Let's say you're dealing with numbers only, numbers, nothing different. Usually what we do is we carry out a dimension and a measure, right? But in this scenario, you want to deal with only numbers. Let's say you are providing some discount on all products, and you wanted to know the profit against the discount offer. Here you are dealing with two numbers, profit and discount. Right? So in those scenarios, what do you do? So that's when you find out by using the scatter plot. Just double click on the canvas. Write it down as build scatter plot. Just check the spelling. S A T E R scatter discount enter and profit. Now it will create a scatter plot based on discount and against the profit. Now you can give some uh dimension. You can go with subcategory. There you go. Now you have the profit obtained against the discount offered based on different subcategories. Just expand it, and you can see in which subcategory what kind of discount was offered and what kind of profits did you make. So 25% uh uh discount was being offered on accessories, and you made a profit—still you made a profit of $33,000. And here you can see almost 200 discount was offered, and still you—I think that is oneplus 1 offer or maybe end of the season sale—but still they made a profit based on some parameters, and here you can see the least discount and highest profit. Okay, the least profit and the highest discount is in terms of tables, which is 33%, the maximum out of everything, and uh they still did not manage to earn some good profits out there. So this is how you create a scatter plot. Just quickly name it as scatter, and next we can deal with the pie chart. Now just double click on the canvas, pie chart, region table. So you have four to five regions here, and using a pie chart would make a good uh impact on this particular visual as everything seems clear, and you can easily make out which particular region made the highest sale by just looking at the size of these pieces. Right now let's quickly name this as pi.
And now let's move to the—you can just uh, you know, you can use the same data for creating a donut graph. You can use the same data used to create a tree map. And yeah, those are similar to one another. And let's let's quickly jump, and now let's create some maps. Right now, when do you need to use map type charts? Let's say your data set has some geographical data, something like city, something like country, something like continent, right, or longitudes, latitudes, anything which gets in touch or gets in line with the geographical data, then you can proceed and build the map data types, I mean the maps, correct? So something which is related to the map data type, you can build a map. Now let me double click on the canvas, this, and ask PowerBI to create a map, country sales. There you go. You have—as simple as that. You have the country-wise sales on PowerBI right here. You can also choose to have filter map, which will show you how much sale is happening. The darkest color will indicate the highest sale, and the lightest color will indicate the lowest sale.
Now moving ahead we have the cards and gauge. So cards and gauge are completely similar to each other. Just click on the PowerBI, double click. You can write card country. Okay, let's go with region because we don't want to go or you can—we don't want to have multiple cards. We just want to have three to four cards on our dashboard. So we'll go with category same. So we'll just have a card here. Right? You can just keep it anywhere on the corner. In terms of real-time dashboard, you you can just keep it anywhere. And uh let's name it as card. Now let's proceed and create a KPI. So multirow card, you can also create a multirow card. Let's say you have uh let's go back to card and check it once. So if you create a multirow card, we have three categories, and you can also add the subcategories of each category. So that's similar to a multi-row card. Correct? Now let's go back to the last type or we have KPIs and table. So KPIs and table are completely similar to each other. Let's try to go with the KPI. Now we have discount, profit, sale, and uh quantity. Correct? So KPI is something which gives you the direct real-time number of what's happening with your real-time dashboard. Correct? Now how many number of, you know, how many number of products are sold? What's the overall sale that we performed? What's the overall profit that we receive? What's the overall discount that we offer in terms of one single u dashboard? You can create a KPI for that. Now let's—let me create a KPI discount first. That's easy as that. Now KPI for the profit. Enter. There you go. Now double click KPI for sale. Enter. There you go. And lastly, KPI for quantity. There you go. Now that's how you create the different types of charts. So basically if you integrate all these charts into one page or one dashboard or one canvas, that's what you call as a real-time interactive dashboard in PowerBI. And again, coming back to the slicers, if you were using Excel, you might have to interconnect each and every single chart using the report connection option, but in PowerBI you don't have to create that particular report connection process. You You can just click on the uh slice or slices, any of the chart, and you can click on the any of the options. Let's say you wanted to find out country-wise sales. You can just click on the country provided, right. So here somewhere you had—yeah, you have Jan, Feb, and everything, right. So if you just click on Jan, every chart available on the PowerBI dashboard will connect to it—connect to the different unit-dependent charts and give you a real-time information without having to create or report connections to each other. Right? So basically if you just add all these charts onto one particular canvas, that's when you get the real-time interactive dashboard in PowerBI, and so I hope you have understood what kind of chart you need to use based on what kind of uh data you have.
So we are on the PowerBI window right now. So here we can see we have already loaded the data. We have the filters, visualizations, etc. And we have the canvas over here. Right. So in the visuals section, if you closely observe, you have the KPI over here, right. So you can either select and drag it onto the canvas or you can just simply double click and create a KPI. But before that, what exactly is a KPI, right? It's the key performance indicator, right? It's a full form of KPI. So what exactly is key performance indicator? Let's say we have the sales dashboard over here, sales data over here, right? Now we have region-wise sales, we have country-wise sales, we have region-wise profits, we have region-wise uh discounts, we have quantity, right? So it's like a visual—it's like a number, clear, literal, readable number, right on top of your dashboard. Right? So if you just want to have a quick glance of how many number of sales you made, how's the profit happening, how's the sale happening, how's the discount that you're getting, right? And how many number of quantity of certain product is been sold in a segment, right? So those are the key performance numbers which will be available right on top of your dashboard. So that's exactly what you call as a KPI. Now how do you create a KPI? So one way is you can just hold the KPI and drag it onto the canvas, or so this is one way of creating the KPI. Let's remove this. Now another simplistic way of creating a KPI is just double click anywhere on the dashboard or the canvas, and you'll have this. So so just write what kind of KPI you want to create. So I want to create KPI for sales. Just create that, and you have your KPI there. Now another one, KPI discount. Just click on that. You have the KPI for discount. Double click once again. KPI for profits. You have the KPI for profits. Now KPI for quantity. There you go. That's how you create KPIs in PowerBI. Should you need to arrange the KPI sizes or color or background, you can also do that by just simply playing around the sections over here, right? The background or the the outline section over here. You can just play with it. You can increase the size, decrease the size, add a background. You have a setting over here. You can do anything that you want. Right?
Now, we will discuss about calculated columns. Now so far what we have done as per our last session is that we did data modeling on the different data sets which we had imported in PowerBI, like products, sales data, returns, fulfillment, customer details uh and customer master data, calendar details, etc. So in the last session we prepared a data model and established the relationships between these different data sets, like one-to-one, one-to-many, many-to-one, one-to-one, etc. And we saw the examples. Now once our relational model is uh prepared, our data model is prepared. Now our next activity is to create certain additional columns which we want to derive bases the data which we have imported. So for example, I'll start with my product data set. Now in my product data set, I want to introduce a column which basically categorizes that if any product which has a color uh you know red, black, or gray, I am going to tag it as a colored product. Rest I'm going to say not a colored product. Right? So all these are like example of by type product SKUs. So for that, now in order to introduce a new column, you just need to do what? You need to select the table in the data grid, go to the table tools and say new column. Okay. So column will get appended to the rightmost part, and you will start seeing a uh formula section typical to like you get in your Excel. Now I'm going to say that the name of my column is going to be bike type color. Okay. And I'm just creating an if condition: if product color is equal to black. Okay. Or or if it is equal to red or if it is equal to gray, then say yes, it's a colored product; else say no. Okay. So now you can see this is the product color red and black. They are saying bike type color yes, blue is no, multi is no, etc., etc. So this is a classic example of an if and else condition-based conditional column. Okay. So you can create such columns. Now second column, custom column which I want to create is I'm going to call as discount. Now bases the pricing of my products, I want to associate certain discounts which I am ready to give to my customers bases the product category, like what is the pricing of the category. Again I'm going to use make use of if else, but in a nested way. So if I'm saying if my product price is less than 100, then I will give 0% of uh 0 percentage of uh discount. So 0 into product price just to keep it consistent. Now I'm saying else if less than 100 then zero; else I'll check again that if the price is less than 500 then I'm ready ready to give 1% discount on the product price; else I'll move further. So like this I have created a formula. So what I'm saying is: if product price is less than 100, give 0%; if it is less than 500, then give 1%; less than 2,000, then 1.5%; less than 3,000, then 2%; and otherwise, else less less than 3,000 if it 2%, else 3%. Right? Now after this column is created. Now you can check, right. So this—see the product price for this particular product, it is less than 100. So that's why there's no discount. It is uh between 100 to 200. Then this has been given a 1% discount. So like this all the discount column is now calculated. Now this column is available just like a regular column in my product table. Now after this I'll go to my sales table. Now in sales table I want to identify uh uh create a column called as cost. There is no product cost column over here. So that will be derived. So let's create a column called as cost, and it is derived by order quantity into—now the cost of the product is in the product table, and I know I've already created a relationship between product and sales table. So I just need to select the product cost column. Now only keyword which I have to use in PowerBI is the related keyword. So this will pick up the relation, and now for this particular sale order, the cost has already been derived. So this order number, this is the cost for which uh the product has—is the costing of the product for this particular order. Okay. Now I'm going to create another conditional column over here called as order status. I'm saying if any order whose order quantity is greater than two, then for my organization it's an urgent order; else it is a normal order. Oh, sorry. I lost it. So, this is my order status column, and I have my order quantity, urgent or normal. So any order which has order quantity one is normal. Any order which is having order quantity as greater than two is urgent. You can see this. So there's a—this whole PowerBI uh tabs and sheets allow you to also review the data what you're doing. So it's very convenient. Now I have my sales data. Now what I want to bring within the sales is my discount column. So here also I want to bring the discount which I have created. So I'll say [Music] discount—discount will be order quantity into related product discount. Right? So the discount calculated column which I had created under products, I'll bring over here. Now I am creating the order-level discount. So if you see for this particular order, there's a 25 uh uh you know for 25 rupee discount at the cost is 100,000 rupees. Okay, and what is the order price now? So I have taken the order cost, the discount. Now I have to create a column called as price, order price. So that will be again order quantity into related price, which is per product price. Enter. Okay. So now I have the cost, the discount, and the price right available with me. Now I want to calculate the total uh total revenue, total profit and loss, right? Per order, how much? So first I'll calculate per order how much revenue I'm generating. So now I have to generate a column called as revenue. Revenue is price minus discount. So 1,700 - 25, 700 - 255, 2071 - 42, and if I want to calculate the profit per order, then it is revenue minus cost. Okay. So now you can see—you know, typical custom columns, calculated columns which we have created are all playing around with the number, numeric values, numeric data primarily and trying to give inferences into per order cost, discount, per order price, revenue, and profit. So typical calculation columns which I have prepared in front of you. Now let's take a look at other different variations of custom columns. Uh I'll create certain columns for text-based custom columns, calculated columns uh using text pix data. So I'm now moving towards my customer table in which I have customer key, prefix, first name, last name, birth date, marital status, and gender. Now I want to create a new column in which I want to derive the age of each customer as of today. Right? So I'll use another function, a date function called as date diff. Now date diff. So I want the difference between the birth date of the customer and as of today in years. Okay. So this customer as of today is 68 year old, one is 74, 68, 57, etc. So this is one derivation of a calculated column of age. Let's take another example. Now this is a text-based column where I want to derive the full name of the customer. Now here I'll say first lower case—in lower case I'll concatenate the prefix, then ampersand space, ampersand first name, ampersand space, ampersand present last name, and closing brackets, etc., full name. Okay. So this is an example of full name in
lower cases. Now another calculated column, a conditional column at the customer level. I want to identify a flag which says who is my target customer. This is the demographics shared over here: Target customer. So I'll say if the marital status is equal to 'M' and total children—hurry—and total children annual income. So, okay. So, let me change the logic a bit. So, marital status is 'M' and age is less than 50. These customers are my target customers. Okay. So I would say "yes," else "no." See, this is his marital status: married, Logan Dias, and age is less than 50; else, everyone. So if I try to filter, so these are my target customers: 69 out of 1178. So this is just a conditional column, but a logical condition, an example which I'm trying to highlight over here.
Okay. Now let's look at certain calendar date-oriented columns, calculated columns, very typical. Like, now I have a simple date column; now I'll keep adding certain columns which, uh, you know, which help you—which will help you—understand how you can, uh, you know, do some calculations on the dates. So, like for example, I want a date which is 12 days after the current date, the date in the column. So just simple: 12 days after; select the date and add 12. Now if you see the date format, you can go and change the format at the top and if whatever you feel like, like this. Now see, 12 days after January 1st, 2015, is January 13th, 2005. You can go and change the format and other details. Let me also show you: if I go to my cost and other columns, I can go and change the format. This is like a currency; cost is currency. So I can go and, uh, select the change the currency type, and you can even show the dollar value or whatever currency type it is. So for numbers you can do currency or text; or dates, you can select the format. So this is available at the column tools level.
Now in customers, like we had our column of full name. So now what all things are available? Format as text; okay, data type text. So very minimal options are there; with date you have options of the date format. Now next, I want a column which defines the expiry date. Okay. So 8 months prior to the expiry date, within which is, uh, coming up in 8 months. So I'll create a column called "8 months expiry," and then there is an EDATE function. I'll use that; I'll use my date in the data set, comma, I'll say 8. So now this date column will append 8 months to my actual date. And again I can go and change the format. Correct.
Now another important column: like I want to know the date name. So I'll use a function called "FORMAT," and I'll select my calendar date column and I'll say give me the "DDD" format of it. So it'll give me the day name, the day, the day name of that particular date. Next: years in between. So I want the years in between today's date and the date of my calendar. So equals DATE DIFF, the calendar date, comma, TODAY, comma, YEAR. 7 years: 2015 to 2022. Then: last date of the month. So if I want what is the last date of this particular calendar month, I will use a function, EOMONTH, which is there, available in Power BI. So I'll say last date of the month equals EOMONTH. Then just select the calendar CSV date, zero in months, and enter. Change the format. Then similarly, start of the month. So I'll use a function called START OF MONTH. So for all January dates, end of the month is January 31st, and start of the month will remain January 1st. Change the format. Next, I want to know what is the week number of that particular date. So now there is an inbuilt function called WEEKNUM; week num, and just pass the date and you will get the week number: first week of the year, second week of the year, etc.
Now another very good example is whether the weekday is a weekday or a weekend. Right? So what is it? It's a week type. Okay. So I'll check; I'll put an IF condition, and there is a function called WEEKDAY, and I'll pass the calendar: if it is less than six, it means it's a weekday; else, it's a weekend. So all Saturday and Sunday day names will come, come as weekends, and else everything else will come as weekday. So these are very different variations of different column types, calculated columns, which is a very important utility, and, uh, and any Power BI project you will definitely be ending up creating N number of calculated columns to derive your numbers, to prepare your reports. But it's important to understand what all things we can do; that yes, there are N number of functions available in Power BI, but, uh, what I have tried to showcase over here is some important functions, but bases your utility, bases your problem statement, you can, uh, look up for a relevant function in the Power BI dictionary.
Now with this introduction to calculated columns, this is the base for us to now get into our next session where we'll be, we will be talking about creating DAX measures and DAX functions. We will be using Power BI DAX functions, which is much more powerful than simple, uh, calculated columns, where you can do more, uh, complex calculations. Uh, you can calculate totals and then use them in the reports. So for that we will look up into our next session. Power BI: let's also learn about DAX expressions, and that's basically your data analysis expressions. So it's basically a collection of functions, operators, and constants which can be used in formulas or expressions to calculate or return one or more values. Now we can basically add a new column. So we can do that, or we can also create new measures. Now usually there is a shorter way of doing it. You can go into modeling, and here, as of now, nothing is highlighted because there is no data uploaded. We see just a new table. What I can do is I can go to home and I can let's get our data, but this time I'll take the simpler data, although we can work on the same earlier data set which relates to IP addresses and all that. So that also can be done, and to learn we can take up this particular data, which is Global Superstore, which we have used earlier.
Now here I can select Orders; I can select People; and I can also select Returns. Now what we can do is before loading we can just do some quick transformation on this particular data. So that opens up my Power Query Editor. So here, if you remember, we have worked on this; this is Returns. So what I can do is I can basically go in here; I can say use first row as headers. Now that's one transformation which I would want to do. Let's go into People, and it basically has Person and Region. We will still do the same thing: Use first row as headers. So that gives me the name of the person and the person belongs to which particular region. You have then your Orders data set, and here things look fine. So we can select different countries; we can select different product categories; we can basically work on your different use cases here, like we have seen earlier. Picking up a category as Technology, picking up a subcategory, and we can also create models based on these three data sets. So this looks perfectly fine to me. So let's go ahead and just do a Close and Apply, and let's have our data quickly loaded. Now as I have explained earlier, it is good to do transformation, enough data wrangling, so that your data is not huge when you're loading it, because then that will slow down your queries, slow down your visuals, slow down your reports, and so on.
Now this is the data we have, and say, for example, I would want to work on a visual. So we know how we can do that. So I can basically click on my Orders. I can look at the aggregated columns such as Discount, might be Postal Code, might be Profit, and it depends if you have basically not changed the data types. Now if you see here, Postal Code and summation really does not go well. Probably this has been as, uh, this has been loaded as a data type which is integer, but Profit and Quantity look good. Row ID, Sales look good. So we can work on DAX expressions. Now here if you go into the modeling, it says do you want to create a new measure? You can create a new column that will get added to your visual. And here when you are looking into the table, you can click on this, and this also gives you an option of creating a new measure or a new column, new quick measure, and you can work on DAX. So when I said DAX, let's quickly look at what or how DAX looks like. Talk about DAX: the simplest way to understand is knowing the basic syntax. So usually you first have some kind of measure name. So, for example, we can say average about something. We can say, okay, let's say Average Sales. So that becomes one of my measures which I'm interested in calculating. Now how do I calculate that? So for that I use an operator. So which shows here. So that's your operator which you are going to use, and then you use a DAX function. So DAX has, or Power BI has, lot of functions which we can use. So, for example, I would use a function like AVERAGE, which we can choose from the drop-down as we start typing in. Now this one as a function then needs a referred data table. So basically, let's say I would be interested in Orders. So I can select my table or my data set as you say, and then you can choose a particular column. So from Orders I would want to do an average on, say, Sales, and I can key in the column name here, and that basically is my simplest DAX expression. So we can have a complicated way of looking at it, or we can basically say, okay, I would want to find out average sales, and I would want to maybe look into a particular city or where I would say it is per city. So maybe I could say Average Sales, and then I could say by city or by year, or I would want to look into a particular year if we have the order date. So we can say greater than a particular order date. So we would want how our sales have got affected after a particular date, and that depends on the situation. So I can do that, and here I can say greater than order date. Now for that, obviously, we have to use the operator, and then I would want to calculate. So I can basically say CALCULATE. Now this is what I would want to find out. So I can say CALCULATE, and then in CALCULATE I can say let's take the column which we are interested in. So we can pass in something like a measure here. So, for example, I can just say Average Sales. This is what I want. But I will give a separator here to filter out the data. And then I am going to use my order date; for example, I can basically say let's take Orders, and in that I am taking Order Date, and then basically this Order Date has to be greater than or lesser than something. So here you are specifying your data set, your table, and the column. You are giving a filter here, and that's basically your DAX expression. So your DAX has different functions. So when we talk about these functions, like as I said, you are going for average or you're going to calculate something. So you have what we, uh, usually mean or, uh, we use is your predefined formulas. Now that can perform calculations by using specific values called arguments, so which are in particular order and structure. So always remember that when you talk about DAX, this always refers to a complete column or a table.
Now there are different categories of functions which we can work on. So you have date and time, such as date difference or finding out NOW or finding out a later time. You can use something like time intelligence, which is dates between first date and last date. You can go for information functions which contains custom data. You can have logical functions, mathematical functions, statistical functions, uh, text functions; you have, uh, basically working on parent-child relationships. So there are different function categories which can be used, and as I said, we can go for creating a new column or a new measure, and we can use this DAX for our data analysis.
Now let's see how we do that. So say, for example, I have my Order Date. Now I would want to work on this. So let's select, say, for example, go to your data set, and you have a lot of data here. So you can basically go for all this data here, which shows me complete information of the different columns, and you can choose which columns you are interested in, which columns might be you would want to cut short. So, for example, I have Order ID; I have Row ID; maybe I don't want a Row ID, so I can choose if I want to delete this, and you can say, okay, I would want to delete this. Now these are some changes which you are applying, and now if you see there is no, uh, Row ID. What we see here as a field, you start with your Order ID; you have your Category; you have your Order Date, Shipment. And here you have your Segment, and for example, we have Country, Region, Market, Category, Subcategory, Product Name, Sales, and then you have your Quantity, Discount, Profit, and all of this. Now what we can do is I can basically add something here. So this is the data which we have, and what we can do is we can continue working on this. So let's click on Home, and here you have ways to transform the data. You have a new measure; you have quick measure; you have new column; and you can try out these. So, for example, I can go into new column, and that basically says, okay, what is your column called? Now I can say, for example, as I was explaining, let's go for Average Sales. So let's call it Average Sales. Now that's what I'm interested in. Now I need to use an internal function. So let's type in AV, and that shows me. Okay. So there is an inbuilt function called AVERAGE. We can use this one. So you can just hit on Enter. And now it says, okay, which is the data set you're interested in? Now based on the reports, based on the data sets I've used earlier, it shows me options of different tables what we have or different data sets what we have. So let's choose Orders. So this is what I'm interested in. You can go for double click, and that gets selected. And now it says, okay, you want average on Sales, but which is the column which you would want to use? So we can go for Category; we can go for Country; we can go for Customer ID. All of these are your different columns. So, for example, I can go for something like Country, and that basically gets selected. Now I can complete this by just closing the parentheses, and that's basically my DAX function. So my DAX function is ready, and if you want you can add details to it. So if you would want to continue your function, you can always do a Shift+Enter; that takes you to the next line. If you do not want it, you can go back. You can add a comment by saying Alt+Shift+A, and then you can say My first DAX function, and you can give in some information depending on what kind of function you are creating, and that basically allows you to create the function. So this is done. Now let's hit on Enter, and basically it will say the function AVERAGE cannot work with values of type string, and, and that's right; I mean, we basically chose the wrong Country; I mean, you cannot have an average on Country, so that's not right; I should use something where I have to take a numeric value. So, for example, I will replace this; so I will say I want Average Sales, and here I can choose what should I take. So, for example, let's go for Sales, and that's what I would want. So it says Order Sales, and then hit on Enter. And it basically has populated my new column. But then it is basically taking average sales, and it has taken average sales overall. Now we have not, we have just selected a column; we have not given any filter. So it just gives me average, and it populates every row with this one. Now this is fine that we have added a column; it has the same average value, and that basically gives me sales on average. So as I said, your DAX function always references a complete column or a complete table, and then basically it adds the value.
Now let's see how we can use this. If you notice the field or the column has got added here. Let's get into visualization, and what I can do is I can basically choose one of the type of visualizations. So, for example, if I choose this and say, for example, I would be adding this Average Sales, and that is the data I would want to look into. So what we can do is we can just say, okay, I'm interested in this Average Sales. It shows me the function, and we can add it here. Now this is just giving me the average sales overall. Now that really doesn't make sense. Let's look at this one or plotted graph. So it gives me what is the average sales, and it gives me some visualization. So we can create visualization like this based on our column. Now what we can also do is we can go back to our data, and we can go for different functions. So as I said, you can create a function that adds a column. Now let's go for something else. So I will say Average Sales, and I would be interested in, say, a particular product. Now we have Average Sales, and that is the measure which we can use. So, for example, I would want to find out, um, wherein the year, or let's look at the date field here. So, for example, we have Country as France. It is telling me City. It is giving me Customer Name. It gives me a Segment. So let's choose a different field, and we can filter by that. So, for example, I'll say Average Sales by, or whatever name you want to give, let's say Segment. Now what I will do here is instead of using this AVERAGE, so I will go for something like CALCULATE. Now I can go for CALCULATE; I can go for CONCATENATE. So let's go for CALCULATE, and we know that we have a particular column. So let's go for this one, which is let's open up a bracket here. So let's go here. Let's give our column name. So that could be your Average Sales. So let's look at what was the column name, and we have Average Sales with an 'SS' capital. So let's go for AVERAGE. And then let's go for Sales. Now this is what I want to do, but on what? So let's choose this, and here I'm going to now [Music] choose Orders. So, and then we have to basically look at the column which has the segment value. So Segment. Now this is what I would want to use, and then we can try giving a value to this. So you have Segment as Corporate. So, for example, let's say let's go for—so it says CALCULATE, give an expression which we have already given; that's your Average Sales, or we can basically give the expression what we did earlier, and then you go for a filtering value. So I'm saying Order Segment, and let's go for something like Corporate. Now that's going to be my segment. Let's close this one. So here's the example. What you do is you give your measure name. So that says Average Sales by Segment. You can do a CALCULATE. Now here you have to pass in a measure. So, for example, I'm saying AVERAGE, and I'm saying take an average for Sales. That is give me an average value of Sales. But what I'm interested in is when the Order Segment is Corporate. So I'm giving a filter here, and then it gives me Average Sales by Segment. So that's the column value here. And it is basically filtering out based on the Segment being Corporate. So Segment is our particular column here which is showing up somewhere. Let me see where is my Segment column. So we have your Product. Now I have, uh, let's search for Country, City, Postal Code, Customer ID. And since we have chosen Order Sales, it is giving me this average value. And you can choose a different column, or you can say Profit is greater than something else. So I would be only interested in those values, and you can continue adding things to your DAX expression, and this is how you can do here. So basically what I did was we were using a measure.
Which is average order sales. I said my segment has to be corporate, or basically you can just say segment has to exist. So you can say a boolean value like equals true. Now I'm saying orders profit has to be greater than 100. And I'm only looking for my average sales by segment where profit is greater than 100, segment is corporate. And now this has calculated the value. So you basically see here. So it tells me 286. If you look at the profit value, so it is greater than 100.
What I can do is I can even add a filter here. So, for example, I can say greater than, and let's give some value here. So, for example, let's go for 100 and let's see if it has done the work. So you see all the average values where it is greater than 100. And then we have to also look at our other values. We can filter it. So segment has to be corporate. And let's apply the filter here. So I will uncheck. I'll say corporate. Now this is what I'm interested in. So it tells me the corporate is sector. Now you see the sales value which is already showing up here which we have. We have average sales by segment which we is telling me that you have corporate segment and it gives you where the profit values are greater than 100.
Now we have this DAX here. We have applied. We have the filter. And what we can do is we can go to quickly visualization. And what I can do is I can choose this. I can add it here. And then that says me average sales by segment. However, we can go for different kind of visualization which can give us more meaning here and look at the data. So this is how you can simply use your tax expressions.
Now this is a simple quick uh session where you are looking at the DAX expressions. So when you look at this symbol, it means it is a tax expression. So you can obviously double-click on this one and that shows you what is your DAX expression. Now as I said, I have given two filters here. So always remember once you have given a measure, you give your first filter and then you can give any number of filters; you can just order it in a different line that should be fine; let's say average sales by segment, okay, so let's say average sales by segment, okay, profit greater than 100. So I can give some kind of name which basically identifies my column and that gives me the value.
Now if you see here, we have applied these filters and that's why we are only seeing the relevant data which is profit which is a particular segment, and you can create any number of DAX expressions like this using some inbuilt functions. So anytime if you would want to see if your DAX expression is working fine, what you can do is, for example, I can say test function. Okay. Now I would want to create a function and then I can basically choose the available functions. As I said, you have logical functions, you have statistical functions, you have mathematical functions, you have information functions. So you have all of these options here and you can choose one of these. So, for example, we were going for average; you have and and or; for example, I can directly go for and, but that would not make sense in the beginning; you can go for absolute value of something. So, for example, let's choose absolute, and now I want to work on orders. So I go for orders and here I can say okay I'm looking at orders but I would be looking at sales value; I I would want the exact value. So I can choose this one right, and here now once I am creating a function, so I can be selecting a different column. So this is basically one column. Now you can add calculation you want to do, but this basically says unexpected expression because this is a new DAG for a new column. So what I can do is I can take this out from here. I can go ahead and create a new column and then or a new measure. So I can do that and it works perfectly fine. Now I can save this and we can call it whatever report you would want to call. So let's say supertore with new DAX, and you can share it, you can publish it, you can continue using it in your reports. So you can create any number of functions as such and then just save it.
So, for example, I have a set of DAX functions and I can upload it on a GitHub link. So here, for example, if I go in here and if I click on DAX, so that tells me the different kind of visualizations I have based on the standard data. So it depends on uh my file which is which should be existing here. So I can go in here and this should actually work, but the location has changed and I just click on open report. I can do a browse report. I can go into PowerBI content, and here let's look into this one and just say open. So that will not only load the report, it has different visuals and uh different visuals with the standard data set which comes with Microsoft, and it basically has different kind of visuals and each of those visuals again have different tax functions. So you can use these also.
So what we have learned is working on a store data set, working on some thread hunting data sets, working on our own created tables, and these are some of the pages what you see here. So this is based on the data which comes in with AWS, and you can always look into one of these and you can search if you see here, look at this icon and it tells me okay this looks like a tag function, and let's double-click on this one and that shows me the function what you're doing. So you're creating a function called age. It uses date difference. It works on dim customer table on the birthday date, and you would want to basically find out the date difference between now and the birthday and you would want the year. So this is the data what you have. You can obviously choose this. You can look at the result of this and you can see the visuals. So these are some simple tax expressions. You can create a lot of data expressions like this. Now this is here you have date function. So I can choose which are the tax functions which are existing here. I can just load them. So, for example, this one is one of my other data sets, and then you can play around with the data here. So this is how you create your DAX expressions, and this is just this was just a quick demo on going for some simple DAX expressions. You can create different kind of visuals and you can then save those reports. You can publish it to PowerBI service and and you can then gather insights based on this.
So this is how you work with PowerBI wherein uh you can use DAX, you can use PowerBI service to gather insights, you can use desktop to work on loading your data, transforming your data in different ways and then basically analyzing it. So these days you might be hearing a lot about PowerBI. We do have a lot of BI tools in the market like Excel, Tableau, Clip View a lot. But people are talking about PowerBI the most, but why? So we will be knowing that in a while. So let's get started with uh building a dashboard first and eventually in the process you will definitely understand it. So making a dashboard in PowerBI is just like a breeze.
So before we get started with PowerBI, I would like to explain you a few fundamentals that you might want to take a look at before getting started. So data cleaning is a much needed process. So you can do data cleaning using Power Query or you can just simply open your Excel and try to check the data types for blank cells, any inappropriate datas, eliminating them. Right? So simple basic fundamental data cleaning process. If you have some irrelevant data in your data set, just eliminate that row or try to fill that with the proper data that was supposed to be there, and if there are any blank rows or blank cells, eliminate those blank rows and blank cells so that your data is up to date and accurate. And apart from that, uh let's check out some data types. For example, the first one which happens to be the row ID here. So this is the data set that we will be dealing with today. So this particular row ID has a general data type. So it can be either a number or a float. And when you come to the ship date over here, the order date over here, right? So those are date data types. And they might follow different uh formatting. Let's say they might follow uh date number that is day number, and for month they might add the alphabetical name like J or FB and the year, or a few others might format with date, time, and uh you know we will be having date uh and the time which will be describing the hours, minutes and seconds, right, so there are a lot of variations where a data from date data type can be saved. So it's your fundamental you know responsibility to make sure that all the elements from a specific column are of one single data type so that the you know entire data set is integr you know it's very um good and it should be intact. That's the whole point of it. And if you have any inconsistencies in your data set that might result in you know abnormal predictions, abnormal dashboards or charts, whatever you make there will not be uh those dashboards cannot be relied on; your reports cannot be uh reliable. So that's the whole point of it. So just make sure that you go through the fundamental very basic data cleaning things like eliminating blank rows, blank cells, maintaining a uniform data type for all your columns you know based on the data. It's not like you have to maintain character data type for your dates. So you need to make sure that what kind of data type suits what kind of data and you need to check that and make sure that all the elements in that particular column follow one standard data type. So I'll be going with date data type for audit date and ship date, and ship mode will be character; serial uh that is row number will be serial number or row number will be integer and uh everything else will be data type, and when it comes to the last four rows, sales, quantity, discount, and profit. So those will be the uh you know float data type, and uh when you check out the location here, we have country, north. So these will be segregated by your BI tool, either Tableau or PowerBI whichever you're using. So those will be segregating these particular location type data types and it will show them as a map, right. So this is the major thing which you need to make sure before starting with your you know building the dashboard. So that you know having said that, let's begin with uh the PowerBI. Let me start the PowerBI BI tool. Here it is. Just click on it. It should take a while.
So here we are. We are on the you know first page of the PowerBI. So you can import the data from Excel. You can import the data from SQL server. You can just copy paste your blank tables. So you can make use of some APIs and plugins and get connected to the data sources from web or any other sources, and you can also import the data from that particular source. So today we will be dealing with the Excel data set. So we will be importing the Excel file, and before that here you can see some options which are filters, data visualizations, and uh data. So we haven't loaded any data. So you can't see the data over here. And if you are on Tableau, they will be available on the left side and you will call them dimensions and measures. So you can apply the same uh analogy here. So you'll be available with the dimensions and measures once we import the data. And here you have a wide variety of charts and graphs that you can just you know drag and drop and create. So once you have the data over here, you can just drag and drop onto the canvas over here, and then it will automatically generate some type of data set or chart. Let's say it'll give you a tabular chart. You can just click that particular chart and come over here, hover over here, and you can uh select any one of the charts available here. Let's say you wanted the pie chart. You can do that. uh you can do a donut chart, you can do a cream map. Right? So once you hover onto it, it will tell the name of that particular chart and you can select that link. It's based on your choice. Right? So this is about it basically. Now you can also do some drill throughs. That's again for a session in another time, another day. So that's a session for a different day. For now let's try to create a dashboard in a routine way. Remember I'm telling you or I'm specifying in a routine way because we are also about to learn why PowerBI is being uh so popular currently in the BI industry. Right? So there are some tips and tricks that will help you in the long term. So let me close the filters, close the visualizations, close the data, and now let's click on this particular option which says import data from Excel. Right now we are in the Excel data set. So this is the file where I basically store my Excel data sets that I'll be working on. So you can also have access to this. You can just let me know, and we will drop down the drive link in the description box and you'll have the accessibility to all these data sets. So remember I spoke about data cleaning, right. So this Excel data, it is completely cleaned. Every data column has a uniform data type and it follows that data type throughout. And if you check out this particular original data set which is sales, European sales over here. So this is the original data set which follows different nominations for data types. For example, if I come down to the date column, there are different types of data types. Some of the cells have only dates. They follow date, month, and year. And some of these cells have date, month, and year along with the time. So another glitch here. So a few of the cells were following the uh you know 24-hour timing nomature, and a few others were following 12 hours, that is specifically mentioned in AM and PM, right, so this causes a lot of trouble when you're creating a report; trust me, I've been there. So what I did is I clean the entire data set, remove the cells, I mean the blank cells, remove the blank columns, remove the blank cells, remove the blank rows, and in any situation if there is um you know uh discrepancy for root in data types. I've also cleared that and I saved it as excel data, right, so we will be using this particular data now, and if you need these data sets, I can provide you with that using the drive link and you can have access; you can also try your data cleaning by following our tutorial which is linked in the description box below for data cleaning and you can do it and you can start with your dashboards. Now let me just extract this particular data set. Just click on open, and you will be having it on the screen just in a moment. So when you check out the original data set, we have a lot of sheets here, right? So these were some pivot tables that we created for data analytics using Excel. So you can also check out that video. Now we will be doing the same data analytics and creating an entire interactive dashboard on PowerBI with the same data set. So you can see uh PowerBI is trying to load all the tables and all the sheets available in that particular file. But we just need one out of those. You can also click all of those or you can just get one out of those. So for now I just need one out of those. So here it is and you can check the data. You can have a quick preview of how your data is looking, right, and then just click on load. And the best part is PowerBI will also perform a data cleaning operation from its end and identifies if there are any rows or any such that I may start to clean, and it will notify you if there are any errors, and it will also I mean it is also capable to you know u fix those errors for you. You can see I have seven errors, right, so I can just view errors and clear them or I can just close so that in the background will take care of them for me. Now we have the data, right. So here you can see the data tab got opened, and here you can have a new dropdown. If you click on that, you have all the data elements present in the data set or in terms of tableau you have dimensions and measures. So basically wherever you have a summation or any kind of mathematical operation present in front of the column name, that particular element or that particular column is considered to be the measure. So which is which is basically dealing with the numbers, and all the others which do not have any other mathematical symbol like equals, hashtag, or summation, those are the dimensions, basically the character data type or the date data type, whichever uh the data type it is but not numbers, right, so here we have it. So what you basically do is completely similar to uh Tableau, click view, or any other business intelligence tool, basically just drag and drop, right. Now let's say I want to find out the um region-wise sales. What can I do here is I can just drag it onto the canvas. And again I have sales over here. I can drag sales to the canvas. I can just you know hover it onto the existing box. You can see this particular box, right, you can just drop it inside the box so that PowerBI will understand that I'm trying to uh you know extract the region-wise sales and it will perform the summation of all the sales region wise and it'll give you a table. Let's say you're not satisfied with this particular tabular representation. You can just hold your table and here you can open the visualizations and open the filters, right, and here you have visualizations over here. If you want to segregate that in form of a pie chart, you can do it right now. It will give you the sum of sales based by region. Now want to calculate the u let's say audit date you know uh date wise and sales, then I can also do that. You can just drag the sales over here and select that particular table. And you know whenever you are dealing with the date data type, right? When you're dealing with a date data type, then what you do is you try to use the line graph. It's the best way to represent your sales how they are happening. Right? And uh few other things. Let's say I want to calculate uh the profit by city or country. Which country is facing the highest number of profits? We can also do that. Just drag and drop. You know how it is. And okay, it's giving a lot of countries, but but still it's not a big problem for us. And just drag and drop the sales. And here you can select any one out of these. Let's go with the biograph. And here you have it. Right now so far so good, right? So far so good. Now if you u worry about the interactivity, you don't have to. Basically when you're using Excel or any other tableau, let's say if you're using Excel, you might have to use slices, right, so if you're not aware of what am I talking about, you can just go check the data analytics of building the dashboard using Excel where I have completely explained the day same data set and we have you know built an interactive dashboard there, so it'll give you a better idea about it. So before that um let's get my let's circle back. So here uh you don't have to create create a slicer and you don't have to report the connections between each and every chart. It's automatically done in the background. For example, let's say if I wanted to calculate the sales of central region, if I just click on the central region, it will automatically change the display of the entire dashboard and will give me the central region sales, right? And uh if I just go back, it'll you know, it'll give me the entire sales dashboard. Let's say if I want to calculate the west region, I have my west data. Right? So that's the best part of PowerBI. And now we are going to identify why this is this is one good reason why PowerBI is popular. But there is
Another good reason why PowerBI is so popular right now. So popular, so easy, and so effective that even a schoolgoing kid can build a dashboard. Trust me, a schoolgoing kid of grade 11, grade 12, or a candidate who is just graduating, or a fresher, or any person who doesn't have computer knowledge but has some good knowledge about numbers and how businesses work, they can definitely create an interactive dashboard using PowerBI, even if they are new to PowerBI. So we're going to just see just that.
Let's create a new page, or you can just go back to the same page. Okay, let's create a new page. Now, let's say I don't know, uh, how to create a chart. I don't know. Let's say my manager asked me to create a complete report of the sales happening, and I don't know PowerBI and I don't know anything about how to create a chart and how it works, right? But I have a certain idea, right? Let's say I have a certain idea. I want to find out the region-wise sales. I want to find out the country-wise sales. I want to find out the performance of sales date on date, year on year, month on month, quarter on quarter, whatever it is. You just want to create, you know, you just want to extract the, you want to build an insight on the date sales, and uh, you want to find out, um, you know, profits based on certain regions or certain categories, right? Which category is the highest performing category? Which is the majorly used shipment mode? Right? There are limitless possibilities. You know what to build, but you don't know how to build. Right? In such situations, PowerBI is here for the rescue.
Just right-click on the canvas. Just click anywhere. Right now you, okay, it was not the right click. It was the double click. So just double-click anywhere on the PowerBI canvas. And there you can see something called ask a question about your data. Let me expand that for you. You can see ask a question anything about your data. Now let's say I want to create the same region-wise sales, right? You can just type on the region-wise sales, and it's already giving you a, uh, you know, it's already giving you a bar graph. Now let's say you don't want the bar graph, you want a pie pie chart or a donut graph, right? Donut chart. So you can either select any one of this. I'll go with the pie chart for now. So you can just select on that. And here you have your pie chart, right? How simple is that? How easy is that? Right? And now you can just place it anywhere on your dashboard. Check the size alignment, and you're good to go. Let's close this filters for now so that the canvas is a little more better visible.
Now let's say I want to find out ship mode profits and uh the type of graph I'll go with the bar graph. There you go. Sales that happened using a certain ship mode. And you have the data right here. And I'm choosing the bar graph. Now let's say I want to calculate the month-on-month sales, right? So double-click anywhere on the canvas sales auditate and remember we want to represent the okay it's too intelligent. It already gave you a line graph right just click that select that and uh just place it anywhere on your chart and you can expand it. There you go. There you have it. Right. And now let's do let's try to find out a few more things. Let's try to find out uh which of these segments gave me a lot of uh profits category-wise profits category profit and let's try to build uh we have a pie chart so let's build a donut chart. There you go. Place it anywhere on the canvas like wherever you need it. Now few more things state-wise. Okay. Now let's make it a little more interesting. State pale map. You wanted a map, right? So just select on that and you will be having the map. Okay. Some problem here. So I think let's go with country sales map. Okay. Let's enter. Now let's select this particular chart. Okay. No interactivity right now. Select this. And here let's select a map and map and filter map visuals are disabled. To enable them go to file options settings options global security details. Okay let's try this file options and settings options global global security use map and field map visuals. I think this should fix this. Okay let's refresh. This should help us. There you go. You have your map. Let's place it anywhere in the dashboard. Now we have the region-wise sales or country-wise sales and the shipment mode subcategory and uh let me know what else we can build. Let's have the KPIs here. Now let's go to the sales. Just drag and drop the sales anywhere on the table. I want the data presented in visuals. I have the card. Now let's have profits and that should be a card again. And let's have u quantity. That should be a card again. That's our KPI. Profit sales quantity discount is another one where which you can add. And just add number card again. There you go. You can go to the insert option. Insert text box. And there you can just write down sales dashboard align with text to center and that should be good. There you go. So far so good. And in case if you wanted to add a few more visual aesthetics to your dashboard, you can also do that. You can just click done. Yeah, I think you remember your PowerPoint, right? Just go to view and you can select any of the backgrounds you want. And there you go. You have it. If you're not happy with this, you can also have some images in the background. You can add some images which will make it look a little more interactive. Right? So that's how you build an amazing interactive dashboard in PowerBI, and uh that's the reason why uh the simplicity why PowerBI is being so popular amongst the all other remaining BI tools.
And now let's get started with the customer analytics dashboard using PowerBI. So we will be using the Amazon sales data sets from 2023 and 2024 for this particular dashboard using PowerBI. So let's quickly switch between the PowerPoint presentation and the data set that we are going to use today. So this particular data set is available on Kaggle and it is actually the data set between 2020 and 2021. So we carried out a little bit of data cleaning process and we enhanced the data set like removing the blank spaces, removing the blank cells and the blank rows basically. So and after that changing the data type of dates. So you might be wondering there might be a few discrepancies in the way the data is formatted because there are many ways for example if I just select this column and go back to data type and if I go to the available dates there are many formats so you can see year month and date date month and year and there is an alphabetical representation of month right so there are many variations where you can represent the date so we are going to use one single format for the entire data set so that it can be easier for us to identify the week on week, month on month, quarter on quarter and yearly u analysis. So that's the whole point of it. First point just try to eliminate any kind of blank cells, rows or columns in your data set so that the accuracy of the data that you are using to perform analysis is intact and good. Right? So apart from that just check if you want to eliminate any of the decimal points just select this and uh here you can see the option to eliminating decimal numbers right you can use this option over here so there are about 2 lakh 86,393 rows in this particular data set so it might take a little while to uh reflect my actions on this particular data set and apart from that if you could uh just hover over through this particular data set you have a lot of things to deal with you have regions you have username, discount, percentage and uh you have uh first name, last name of the user, quantity, order, price, value. So why are we basically going through this particular data set is it is when you understand it is when you can quantify what's happening with your data set. That's when you can plan out what kind of analysis you want to perform. Right? Let's say you did not get any kind of prerequisites from your manager. They just had the head and you need to perform the exact uh you know analysis which could benefit your organization. So they also want some insight so that they can make out some decisions out of it right some business decisions. So in that situation you just have to go through the data set once and do the data cleaning process and then understand what exactly has been mentioned in this particular data set and what kind of u insights you can extract out of this data set and you can proceed with that. So basically we have quantity ordered price value and uh total. Apart from that you have category, you have uh different payment methods, you have uh the year, you have the dates and uh you so when you have dates you can also create some trend lines out of it and apart from that u let's say you have zip codes region right so you can find out region by sales and a few more things what you can basically do out of it right so uh having the data set understood let's go back to powerbi so this is our powerbi platform so basically doing is select this particular Excel workbook option and import the data. I've done it basically. Here you have it. So we have the age, category, city, country, everything presented over here. Now let's quickly create the visualizations using this particular data set. So I would firstly go with a bar graph. Okay, let me choose this uh bar graph right over here. And uh let me create gender-wise sales. Let's let's have this gender here. So we should be having something called as a price or a sale. So we have price over here. You can quickly draw and drag this and drop it on the x-axis. Okay, we y-axis and uh gender on the x-axis. So we don't want this filter over here. You can eliminate this. So now you have u gender-wise sales right now. Next let's use a pie chart. Now you can find out the region-wise sales. Quickly add the region into the legends. Here you have the region-wise sales. So uh you have midwest, northeast, south and southwest regions. So these are the sales number uh line graph which can help us to do. Okay. So just click on the canvas and then double-click for your drop the sheet. Now let's use the auto date and drop it onto x-axis and um rise onto y-axis. Now if you could uh use the drop-down and use the date hierarchies you can use the year on year month on month. So let's go with month on month or quarter. Okay let's go with quarter on quarter. Now you can see how are the sales running quarter-on-quarter in the for this particular data set. So we have two years that is 2020 and I mean yeah 2023 and 2024 the quarter-on-quarter comparison for year-on-year sales figures right now let's click on the canvas once again and now you can choose the over here and uh so since we have two genders and I think we also have a column for age it should be somewhere in the So basically you can derive what age groups have made the maximum number of sales right. Yeah. So here we have it and the sales. So basically it'll create a bucket right uh age group from 18 age group from 19 20 21 and so on. Now just go through the orders or you can go with the price. So just drag and drop it in values and you have it here and you created a donut chart of it. And uh let's try to create a field map now. Uh you can understand which uh area which region was the highest uh sales uh we received. So just go through the data set over here. So we have the country. Just drag and drop the country and then have the price or orders. You can use anything. Okay, let's go with the orders. Quantity order and add it in the values. So here we have it. So if you could expand you can find out which region was the one which the highest number of orders. And there is another simple way to do it as well. If you just double-click on the [Music] canvas give you a prompt where you can write map country-wise map. Okay. Map state. So we have a state uh column here sales or price and uh it will automatically understand your query and create a map which will show you the highest number of sales from the regions or the region of state-wise sales. Brilliant. Now if we proceed into the funnel chart, okay, we have a waterfall chart. So now you can create a waterfall chart. So you just name it waterfall. So we have u category somewhere. Yeah. Waterfall category-wise. Just enter price or sale. And we have a waterfall chart over here based on the categories. You can just drag or you can expand the canvas to have a clearer picture. And uh yeah so far we have dealt with okay we have a scatter plot we can do a scatter plot scatter plot for quantity of orders received against discount offered. So we should be having quantity ordered 2T by against discounts or I think we can go with order idies. So it'll give us a unique uh representation there has been a small discrepancy order id or you can also go with customer id against discount offered. So we have a huge data set two lakh plus. So it might take a little while to respond to the requests. That's completely all right. Now what left out is the KPI. So you can also create some KPIs. So just double tap and uh write a KPI for total sales. Write a KPI. Total orders 29,000 orders. API for total discount. KPI for discount percentage. We can use KPI for gender which can tell us how many number of females or how many number of males did create an order. We will be having a number here. All righty. If you could just close these visualizations over here, we can expand the canvas and you can also have Okay, we can also minimize this particular area. And we can also have another chart or bar bar graph for types of payments, payment types. Payment method right so we will be generating a bar graph with highest number of payment methods used that is cash and delivery online payment emis etc so it will take a little time to reflect on this particular screen that's all right now if you can just go to view and here you will be having various options for representing your data set just click on the best way to represent your data set there you go So basically that's how you create. Okay, let's try to rearrange our charts a little bit so that the KPIs and KAS are clearly visible. There you go. So that's how you create a customer analytics dashboard using PowerBI.
PowerBI makes data visually appealing. It has easy drag-and-drop functionality with features that allow you to copy all formatting across similar visualizations. PowerBI fetches data from factory sensors and social media sources to get access to real-time analytics. Let's see what Tableau really is. Tableau is a powerful business intelligence tool which manages the data flow and turns data into actionable information. It can create a wide range of different visualizations to interactively present the data and showcase insights. Tableau has the feature of drag and drop which allows its users to create interactive visuals quickly. It can also build interactive dashboards with just a few clicks.
So PowerBI was originally designed by Ron George in the summer of 2010, and the initial release was available for public download on July 11th, 2011. The key components of PowerBI are PowerBI Desktop, PowerBI service, PowerBI mobile apps, PowerBI gateway, and PowerBI report server. Tableau software was founded in 2003 in Mountain View, California. And the Tableau Desktop 1.0 was released in 2004. On August 1st, 2019, Salesforce acquired Tableau. Tableau products include Tableau Desktop, Tableau Server, Tableau Online, Tableau Visible, Tableau Public, and Tableau Reader.
Now, let's see how expensive these tools are. PowerBI is way less expensive than Tableau software. PowerBI professional version costs less than $10 per month per user. The yearly subscription comes around $100. PowerBI Premium is licensed with dedicated cloud compute and storage resources and is priced at $4,995 per month. On the other hand, Tableau is more expensive where the pro version of Tableau comes at more than $35 per month per user. The yearly subscription costs around $1,000. Tableau Creator costs around $70 per month, while Tableau Viewer is priced at $12 per month. If you are a startup or a small business, you can offer PowerBI and then upgrade to Tableau if the need arises.
Now coming to performance, PowerBI is easy to use. It is faster and performs better when the volume of data is limited. PowerBI tends to drag slow when handling bulk data. But Tableau can handle large volumes of data easily. It is faster and provides extensive features for visualizing the data. Tableau doesn't limit the number of data points in a visualization or enforce row or size limitations, so you can have a complete view of your data. Tableau's wide range of built-in analytic capabilities allows you to spend less time worrying about manually creating calculations, designing visualizations, and formatting dashboards.
Now, let's discuss the user interface of these tools. The user interface of PowerBI is highly intuitive and it can easily be integrated with other Microsoft products. PowerBI interface is easy to learn and understand. It is user-friendly and allows you to operate better. PowerBI Desktop provides three views which you can select on the left side of the canvas. The first view is of the report view where you can create reports and visuals. The next is the data view. In this view, you can see the tables, measures, and other data used in the data model associated with your report and transform the data for best use in the reports model. And third is the model view. In this view, you can see and manage the relationships among data in your data model. Tableau has an intelligent interface that enables you to create and customize the dashboards according to your requirements easily. It has an inviting workspace area that encourages you to experiment with data and get smart results. The workspace area has different cards and cells, toolbar, sidebar, data source page, status bar, and sheet tabs.
With that, let us now talk about the different data sources that PowerBI and Tableau can connect with. Another important feature of PowerBI is that it supports various data sources but has limited access to other databases and servers compared to Tableau. Some of the examples are Microsoft Excel, text or CSV files, folders, Microsoft SQL Server, Access DB, Oracle database, IBM DB2, MySQL database, PostgresSQL database, etc. Tableau software has access to numerous data sources and servers such as Excel, text file, PDF, JSON, statistical file, Amazon Redshift, Cloudera Hadoop, Google Analytics, Dropbox, Google Sheets, Google Drive, and lots more.
Now, let's talk about the ease of use. PowerBI enjoys a slight edge in terms of ease of use because it is based on a user interface that has its roots in Microsoft Office 365, which most end users are already familiar with. Tableau provides some essential advantages for exploring and visualizing data in detail. Tableau is also incorporating natural language capabilities into its software. This will help us in finding solutions to complex problems by understanding the data better.
Next, let us understand how PowerBI and Tableau differ in terms of programming support. PowerBI supports Data Analysis Expressions or DAX and M language for data manipulation and data modeling. It can connect with our programming language using Microsoft Revolution Analytics, but it is available only for enterprise-level users. Compared to PowerBI, Tableau integrates much better with our language. Tableau Software Development Kit can be implemented using any of the four programming languages such as C, C++, Java, and Python. By connecting to these programming languages, you can build even more powerful visualizations.
Now coming to the most important category which is data visualization. PowerBI provides an easy-to-use drag-and-drop functionality. It provides features that make data visually appealing. PowerBI offers a wide range of detailed and interactive visualizations to create reports and dashboards. Using PowerBI service, you can ask questions about your data and it will give you meaningful insights. Tableau also allows its users to customize dashboards specifically for a device. It delivers interactive visuals that support insights on the fly. It can translate queries to visualizations and makes you ask questions, spot trends, and identify opportunities. No coding knowledge is required to work on Tableau as Tableau provides inbuilt table calculations to build reports and dashboards.
Now talking about machine learning and how they are different from each other. PowerBI enjoys the advantages of Microsoft business analytics that includes platforms such as Azure machine learning, SQL Server-based analysis services, data streaming in real time, and many Azure database offers. It helps to understand the data and analyze the trends and patterns in the data. You can also forecast the data to make future predictions. Tableau supports the features of Python.
machine learning. This enables it to perform machine learning operations over the data set.
Finally, let's talk about customer support. Microsoft PowerBI is relatively younger in the market than Tableau and hence it has a smaller community. While Tableau has over 160,000 active users participating in over 500 global user groups and over 150,000 active customers participating in the Tableau online community.
That's a wrap on our PowerBI full course in 2024. If you have any questions or want to share your experiences, then leave a comment below. Your feedback helps our community grow. If you found this course useful, please give it a thumbs up and consider sharing it. Don't forget to subscribe and hit the notification bell for more updates.
Staying ahead in your career requires continuous learning and upskilling. Whether you're a student aiming to learn today's top skills or a working professional looking to advance your career, we've got you covered. Explore our impressive catalog of certification programs in cutting-edge domains including data science, cloud computing, cyber security, AI, machine learning, or digital marketing. Designed in collaboration with leading universities and top corporations and delivered by industry experts. Choose any of our programs and set yourself on the path to career success. Click the link in the description to know more.
Hi there. If you like this video, subscribe to the SimplyLearn YouTube channel and click here to watch similar videos. To nerd up and get certified, click here.
In this video, you're going to learn one of the world's leading business analytic tools, that is PowerBI. Imagine mastering PowerBI, the tool that transforms raw data into meaningful insights and opening up endless possibilities for innovation and career growth in 2024. As businesses become more data-driven, the demand for analytics skills is booming. PowerBI leads the way with top solutions in data visualization, business intelligence, and data analysis. Dive into the world of analytics where professionals can earn between $80,000 US to $120,000 US annually and learn how to become a key player in this data revolution.
In this course, you will uncover the basics of data analytics, learn steps to become a PowerBI expert, and get hands-on experience with real-world labs. You will also get an introduction to advanced features, compare PowerBI with other analytics tools, and prepare for job interviews with PowerBI questions and answers. Finally, explore data analytics certifications to boost your credentials.
Craving a career upgrade? Subscribe, like, and comment below. Dive into the link in the description to fast-track your ambitions. Whether you're making a switch or aiming higher, SimplyLearn has your back.
But before we commence, if you are really interested in elevating your data analyst skills with Simply Learn's PL300 Microsoft PowerBI certification training, then look no further. This course helps you learn to use PowerBI desktop, create reports and dashboards, and present data clearly. You'll get hands-on experience in real-world projects and labs and access practice tests to prepare for the PL300 exam. Join over 42,000 learners who have rated this course 4.5 out of five. Learn to make dashboards, get better insights from data, and solve business problems with PowerBI. This course includes 30-plus hours of learning projects, lifetime access to content, and live sessions with experts. Check out training options. So let's get started.
Now let's understand why PowerBI is needed. First, PowerBI has the ability to access vast volumes of data from multiple sources. It allows you to view, analyze, and visualize huge quantities of data that cannot be opened in Excel. Some of the important data sources available in PowerBI are Excel, CSV, XML, JSON, PDF, etc. Second, PowerBI provides an easy-to-use drag-and-drop tool with features and functionalities that allow you to copy all formatting across similar visualizations. PowerBI has exceptional integration with Excel. It helps you gather, analyze, publish, and share Excel business data. PowerBI helps to accelerate big data preparation with Azure. Using PowerBI with Azure allows you to analyze and share vast volumes of data. Azure data lake can reduce the time it takes to get insights and increase collaboration between business analysts, data engineers, and data scientists. PowerBI allows you to get insights from data and turn insights into actions to take data-driven business decisions. Finally, PowerBI allows you to perform real-time stream analytics. It fetches data from multiple sensors and social media sources to get access to real-time analytics. So you are always ready to make business decisions.
Now let's see what PowerBI is. PowerBI is a business analytics service provided by Microsoft that lets you visualize your data and share insights. It converts data from different sources to build interactive dashboards and BI reports. As you can see, we have an Excel data about sales. Using this data, PowerBI helps you build different charts and graphs to visualize the data.
Now that we have understood what PowerBI is, let us look at the important features of PowerBI. First is PowerBI desktop. PowerBI desktop is a free software that you can download and it allows you to build reports by accessing data easily. For using PowerBI desktop, you do not need advanced report designing or query skills to build a report. Second, as already discussed, PowerBI supports stream analytics from factory sensors to social media sources. PowerBI assists in real-time analytics to make timely decisions. Third, support for multiple data sources is one of the major features of PowerBI. You can access various sources of data such as Excel, CSV, SQL Server, web files, etc. to create interactive visualizations. And finally, custom visualization. Custom visualization is another vital feature of PowerBI. While dealing with complex data, PowerBI's default standard might not be enough in some cases. In that case, you can access the custom library of visualization that meets your needs.
Let us jump into discussing the various components of PowerBI. As you can see, there are six major components of PowerBI. Now, let's discuss them one by one. First is Power Query. Power Query is the data transformation and mashup engine. It enables you to discover, connect, combine, and refine data sources to meet your analysis needs. It can be downloaded as an add-in for Excel or can be used as part of PowerBI desktop. Second, we have Power Pivot. Power Pivot is a data modeling technology that lets you create data models. It also allows you to establish relationships and create calculations. It uses data analysis expression language or DAX to model simple and complex data. Third, we have Power View. Power View is a technology that is available in Excel, SharePoint, SQL Server, and PowerBI. It lets you create interactive charts, graphs, maps, and other visuals that bring your data to life. Next, we have Power Map. Microsoft's Power Map for Excel and PowerBI is a 3D data visualization tool that lets you map your data and plot more than a million rows of data visually on Bing maps in 3D format from an Excel table or data model in Excel. Then we have PowerBI desktop. PowerBI desktop is a development tool for Power Query, Power Pivot, and Power View. With PowerBI desktop, you have everything under the same solution and it is easier to develop BI data analysis experience. Finally, we have Power Q&A. The Q&A feature in PowerBI lets you explore your data in your own words. It is the fastest way to get an answer from your data using natural language. An example could be what was the total sales last year. Once you have built your data model and deployed that into the PowerBI website, then you can ask questions and get answers easily.
Now, let's see what PowerBI service is. PowerBI service is the software as a service part of PowerBI. It is also referred to as PowerBI online. To access PowerBI service, you need to log into app.powerbi.com. Now, let me show you that. I'll go to Google. I'll open a new tab and search for app.powerbi.com. It's loading. But this is how the homepage of PowerBI service looks like. I've created some dashboards on it. First, you need to log into app. PowerBI service. You can see I'm logged in. Now, under my workspace, if I go to dashboard, here I have created a finance dashboard; you can see the different charts and graphs I have prepared and pinned it to the dashboard. So PowerBI service allows you to connect to your data, create reports and dashboards, and you can also ask questions to your data.
Now, as you can see in this dashboard, we have created some charts and graphs. So this is a tree map, there's a pie chart, there's a bar graph. Below you can see there are line charts and donut charts. It tells you the total sales that were made, the total number of units sold, the sales by product, sales by country, sales by segment, and lots more.
One of the key features of PowerBI is creating dashboards from multiple reports and data sets. PowerBI dashboard is a single-page visualization to tell a story. The visualizations on a dashboard are generated from multiple reports, and each report is based on one data set. A single-page dashboard is known as a canvas. The visualizations you see on the dashboard are called tiles. These tiles are pinned to the dashboard by report designers.
Now let me go back to my dashboard. So this is called a canvas, and each of these are called tiles. So on the top, you can see we have three tiles.
Now let's understand how to create and publish reports in PowerBI dashboards. PowerBI allows you to create different reports on PowerBI desktop. These reports can be published on the PowerBI dashboard using PowerBI service. Here you can see there is a PowerBI report created on PowerBI desktop. If you click on publish, it will take you to the PowerBI service where you can build a dashboard. Here is the button for PowerBI publish. Once you click on PowerBI publish, it will take you to the dashboard. So this is a single-page PowerBI dashboard on PowerBI service.
Now let's understand the PowerBI architecture. PowerBI architecture is a service built on top of Azure. There are multiple data sources that PowerBI can connect to. PowerBI desktop allows you to create reports and data visualizations on the data set. PowerBI gateway is connected to on-premise data sources to get continuous data for reporting and analytics. PowerBI services are basically the cloud services that are used to publish PowerBI reports and data visualizations. Using PowerBI mobile apps, you can stay connected to their data from anywhere. PowerBI apps are available for Windows, iOS, and Android platforms.
Now let's look at a case study on how Meyer, which is one of the United States' largest supermarket chains, used PowerBI to solve its business problems. Initially, Meyer had become dependent on its IT organization to extract insights from its data. It was time-consuming and inefficient as you had to wait for it to build every report. Meyer was unable to perform ad hoc and real-time analysis easily. So what Meyer did was it connected PowerBI to an on-premises SQL server analysis services cube. This allowed them to refresh 20 billion rows of data in near real-time. With PowerBI, teams can now pull in the data faster and perform real-time analysis to derive insights from data. A bakery department inside Meyer used PowerBI to compare its sales with regional performance. They analyzed where Meyer was behind the regional trends, focused on the problem, and created a solution. With PowerBI, they can now drill down into hourly sales and send out a sales flash to 800 Meyer business leaders. So PowerBI enabled them to standardize data sources and empower store directors and team leaders to develop and track that data to ensure what they can improve.
Now let's do some practical hands-on demo with PowerBI. So this is how the PowerBI desktop interface looks like. On the left, you have the report view, the data view, and the model view. The report view is where you visualize your data with different charts and graphs to build reports. The data view allows you to view the whole data while the model view is where you check if there are any relationships between the tables. On the right, you can see the different visualizations that you can build. We'll quickly run through all of these in our demo. So here you can see there's a finance sample data that will help you draw insights about the sale of products in different countries. We will create a report to visualize different charts and graphs and analyze those sales. So let me go to my PowerBI desktop. First, we'll import our data. So let me go to our get data tab and choose Excel as my data source. I click on Excel. So here is our finance sample data. We'll select sheet one. You can see the data here. Click on it and then select load. This might take some time to load the data. Now if I go to my data tab, you can see the entire data set. It has fields such as segment, country in which the sales was made, the name of the product, the units sold, and the sales price and many more. Let's start building our report now. I'll go to my report view. So, first let me create a text box. Let me resize it. Let me name it as finance dashboard. We'll increase the size of the text. We'll use font Consolas. Center it. We'll also add a background to this. We use blue color, change it to white and increase the size. Now let me first show you how you can create a matrix. I'll go to visualizations and click on matrix. Let me resize it. From the data sheet tab, I'll select sales and drag onto values. So you can see the total number of sales that were made. Now let me do some formatting. So I'll go to the format tab. Click on column headers. Let's add a background color. And let me increase the text size to 20. Similarly, under values, we'll increase the size of the text to 20 as well. We can also click on border and choose the color of the border. We take as let it be black. So this is a simple matrix that we created which shows the total number of sales that were made. Similarly, let me choose matrix once again. Now, we'll drag on the units sold onto values. We'll continue with the same drill. Under column headers, we'll add a background. This time, let's choose some other color. And under values, let's increase the size of the text to 20. Even for the column headers, let's increase the size of the text to 20. Again, we'll switch on border. Me resize a bit. So here we have two matrices created for our report. The first matrix shows us the total sales that were made. The second matrix shows you the total units that were sold. Now let's move ahead and create a simple bar chart. So under visualization I click on clustered column chart. Under this, we'll drag the date column onto axis and the sales onto value. Let me expand it. So, it shows you the sales per year. This is the sales that were made in 2013 and this shows you the sales that were made in 2014. Now, there's a drill-down option which gives you more granularity. This depicts the sales by quarter. If I drill down further, you can see this shows you the sales by month. Also, you have some options like sort by and sort by sales. So you can see October month made the highest number of sales. Moving ahead, let me now create a pie chart where we will see the sales by different segments. Under visualization, I'll click on pie chart. Let me first resize it. Here I'll drag the segment column onto the legend and the sales column onto the values. As you can see, we have the sales made by different segments. Government segment made the highest number of sales with 44.22%. Now, let me add a border to both the visualizations. I'll click on the pie chart and go to the format tab. I'll switch on the border. Similarly, for the clustered column chart, I'll go to the format tab and click on border. Now, let me resize a bit. All right. Next, we'll create a very simple table that will depict the total sales made by each product. So, under visualizations, I click on table. Let me bring this below. So, from the data sheet, I'll first drag product onto values. You can see the different products and then sales just below it. So, this depicts the total sales that were made by each product. And finally, it displays the total value of the sales that were made. This is the same as the one shown here. Now, let's do some formatting. Under the format tab, I'll go to values and increase the text size to 15. Let me expand it. Also, under column headers, I'll increase the text size to 15. Then, let me go and add a border. Now let me create a map that will show you the sales that were made by each country. So first let me create a new page and under visualization I'll click on map. Now I'll drag the country column onto location. So you can see we have our map ready and we'll drag sales onto size. You can see the different countries and the sales that they made. If I move the map, you can see the sales made in the Europe region. Let me resize it. I'll add a border to this. Now, let me go ahead and create a donut chart that will show you the profit by each segment. Under visualizations, I'll click on donut chart. I'll move this to the top. Now, from the data sheet, I'll add profit onto the values and segment onto the legend. If I expand this, you can see the government segment made the highest amount of profit with 65.04%. Let me resize this and we'll add a border. Okay. In the final visualization, I'll show you how to create a tree map. This tree map will tell you the total amount of sales made by each product. So, under visualizations, I'll click on the tree map. Let me expand it. I'll drag sales onto values and product onto group. So here you can see our tree map and the sales made by each product. You can see now we have our report ready. We have created two separate canvases to visualize our data. Now if you want to change the color of these bars, you can simply go to the format tab and under data colors, you can choose whichever color you want. In PowerBI desktop, you have an option to switch your theme. This will make your dashboard or the report look more attractive. So now we are under the default mode. Let's try out different themes. That's Frontier. It's Temperature Solar which is a little yellowish. The one which I like is Tide. I hope this was helpful in making you understand the basics of PowerBI and how it works. You learned the various features and the components of PowerBI and looked at the architecture of PowerBI. Finally, you saw a demo to create a report using finance data set.
Now, let's get started by how to install PowerBI in Windows operating system. To install PowerBI, go to Google and search for PowerBI desktop download. Now, click on the first link and then you will be redirected to the official web page of Microsoft PowerBI. Here you have to scroll a little towards the bottom and select your language, which is English, and then click on download. This will give you two options. So based on your processor, select one. My system is 64-bit. So I'll be selecting this one. Now, the download file will be 558 MB. So it might take a little time. Now you can see your Microsoft PowerBI is getting downloaded. So if we go into the download section, you can clearly see it. So here it is getting downloaded. It might take a little time. Now the file has been downloaded. Just run the file and you can directly go to next. Since the default language is English, and in case if you want to select a particular language, you can go to the select language option and select your particular language you're searching for. It might take a while. There you go. So the installation process has been started. Now you can click on next. And now you can read all the terms and agreements and click on accept. You can change the location if you want, but I'll be keeping it as default. Again, if you want to create a shortcut, you can on the desktop. I'll keep it as it is. Now install. It might take a while. So PowerBI has got successfully installed. You can see the desktop icon there. Double click on it and you can start PowerBI. So firstly, it is open source. If you want to have a licensed version of it, just get the license or buy; no option. And for now, let's use the open source version. So this is the PowerBI window, and those are the charts and these are the data connections. If you want to get connected to your data sources, you can also have shortcuts to that.
Now, what are the steps to connect to data? So now we will go directly into PowerBI and try to import one by one a few most commonly and popularly used data sets which are most commonly used in a day-to-day activity. Rest of course, there are PowerBI supports any number of data sources, but we will do something practical on the most popular ones. So let's let's open our PowerBI. Now this is my PowerBI, and first, I want to show you that how can I import data directly from a web page and import the data. Now it is asking for a URL in order to import data. So what I have done is I have created a Google Excel sheet with simple data with rows and columns, and what I have done is I have shared this sheet as published to the web. Okay. So you just need to say publish to the web the link as a web page and say done.
It's automatically published and say link. So copy the link which you have published on the web. Copy this link and then go back to your Tableau. Paste it link over here and click okay. Now PowerBI will try to establish a connection with this Google doc sheet because it's published on the web. You need to wait for a while while it is reading.
Okay, now it has read one of the HTML tables. So I'll select this one. Now you can see it has it is showing me a preview of the table which is there on my Google sheet, right? It has 11 rows. So it has all showed all the 11 rows. So now I can go and transform this data because I can see my headers are there starting from the second row. So there's an opportunity for me to transform the data. So I'll go and transform it so that it looks clean.
Okay. So first is I need to remove the first row which is the null row. Remove the top rows. Okay. And then I need to use the first row now as a header. So you just click this option use first row as headers. That's it. So now if you see my row ID, order ID, order date, ship date, all my data is now ready. So I can say close and apply. Click apply changes.
Now this is an example of web data import. You can go and preview your data right now. Uh, the biggest advantage of this data connection is that it's a live data. So for example, I insert another row. Let me change the order ID. Some some I've changed some basic stuff and I it's autosaved. Control S. Now I'll go to my tableau and I'll refresh. Now you can see as I refreshed my power query editor, I clicked refresh all and I got my new row which is there in the live data. I got that fetched from my Okay, I got that row the row row ID number 12. So I I have to say close and apply. Now you can see the new row the row number 12 is now available in my new data set in the data set because it's a live connection. It's a live connection with the web-based Google sheet. Okay. So this is one important way in which you can import data.
Now let's try to import data from a text file. Now I have already prepared a text file called subcategories.txt. Now let me just open it in a notepad. Now it's a very plain simple file tab separated file in which you have product subcategory ID, subcategory name and product category key. So basically to which product category this particular subproduct belongs to. Right? So, what I'm going to do is I'm going to go back to my get data option and I'm going to select text/CSV option and I'm going to select option mod product subcategories.txt. Okay. So now PowerBI has identified that it's a tab delimited file. It has recognized the headers etc. Right? And I can now directly load this file. Okay. So now once the data is imported in PowerBI, it is like irrelevant to me. It's a composite data in import right. So in my presentation when I'm talking about importing data there are different importing modes, right? Import data import can happen through different ways. Okay. one is direct query mode in which I create a live uh connection to the database which I'll also show you uh using MySQL and MS SQL server and also you can do a composite mode in which you can have data imported from Excel plus you can have direct query modes so you can have multiple uh modes to connect and create a composite data model and that's what we are doing right now in our practical so what we are doing over here is one we have imported data from the web second we have imported data from a text table now after doing text now our next task is to import from CSV let's try another one so now I have imported product subcategory now I'll import a CSV file so again I'll choose the option text/ CSV and now in this CSV file let me open this CSV file file and show you what in is it. So this is a list of all my products, product key, product subcategory key, product uh stock keeping unit etc. A simple CSV file and I'm going to import that. Okay. So now it has identified the delimiter is comma rather than a tab and it has already recognized the headers correctly. So I'll load it. Okay. So now my products are there. product subcategories are there for product categories. Now what I have done is I have created a Excel mode now. So now Excel I'm using to import my product category. So now I have to click on the option of import data from Excel and I'll say product categories. Select the sheet. Load and now so my products product categories product subcategories do with different uh uh data storage types but still now the data is imported into PowerBI. It is a composite data model.
Now another very important data type which you can import is the PDF also. Right? So what I have done is I have created a PDF called customers. My customers data is lying in a PDF. So what I've done is I've created a PDF which has data for some columns are there like you know customer key, prefix, first name, last name, birth date, marital status, gender, email address, annual income, total children etc etc. So this is the data set which I have created in PDF. So what I'm going to do is I'm going to select PDF now and import customers PDF. And see it has recognized my table on page one which I'm going to load. Okay. You can rename this as PDF table. So this basically these are the different type of data types we have imported PDF, Excel, text, CSV and web page.
Now let's take a look at another interesting data set which we want to import is the my SQL server data set. So what I have done is I've already installed MySQL server on my local instance and there's already a schema of SQL live tutorial over there and I have certain tables already prepared over there like department employee etc. So my goal is now to import this data or create a live connection with this data set. Now in order to import my SQL database connection in PowerBI you need to first download a connector MySQL PowerBI connector. So you need to go to this link and then click on download and install the MySQL connector based on the operating system you have. and click on download and install it. After you have done this, go back to PowerBI and then give the IP address of the database. In my case, it's there in this local machine and the schema which I want to import is SQL live tutorial. So, I'll give the name. Click connect. Okay, now it's connected. So now it is asking me which particular tables you want to create a connection with. I'm choosing department and employee and I'm just loading them. Okay. So now this is the exact data which is there in the employee and department in MySQL. Okay. So this is one example of how to create connectivity between PowerBI and MySQL.
Now I want to do the same thing using SQL server, Microsoft SQL server. So I have also installed Microsoft SQL server on my machine and I have used the SQL Express. So this is the name of my server. So which I'll copy the server name and go to get data. Select SQL server and for now database is optional. I can say direct query. Click okay. Okay. Now it is showing me what all tables I can import. So in my SQL server tutorial in my SQL server I have I have these three tables customers employee attrition Olympic events. So I can use probably the customers one which is Now you can see this is the data the customer's data which is lying in my SQL server. Okay. So I can preview it and load it. So now you can you can preview the data in uh PowerBI that this this is the data. So I can rename is customers from MSSQL and this is from my SQL and okay. So now this is not the only uh data sets you can import. Now if you take a look at the options which PowerBI gave of what different type and variations of data it can it has compatibility to import from. Okay. So we can just take a look at the categorization on the left hand side first. There are file based like excel, text, XML, JSON is also possible. You can evenly directly import entire folder and within the folder whatever uh data types of files are there it'll detect it. PDF, park key or even shareepoint folder which is itself a Microsoft uh technology. Then different kind of databases SQL server and my SQL we just saw but it's not only limited to this. You can connect to Microsoft Access, SSAS, Oracle database, IBM DB2, Postgress, uh, Caiase, Terodata and then SAP uh, uh, databases, Amazon, Red Shift, Impala, Vertica, Snowflake and any number of databases which are there in the market today uh, Amazon etc. Then it also allows you to connect with its own power platforms. PowerBI platforms, data mods, PowerBI data flows, data vers etc. Azure, there are different kind of storage uh mechanisms in Azure and Azure itself is a Microsoft technology. So it has a compatibility with lot of Azure uh based data stoages like Azure SQL database, blob storage, uh Azure data bricks, right? Azour HD inside Spark. So if you have those kind of services running on your Azour cloud services, you can even import them over here. Now online services like you know you have ERPs running uh or some data which is shared on the internet if you want to import it uh that is also possible through certain products uh Dynamics 365 Microsoft Exchange online Salesforce Google Analytics Adobe Analytics GitHub uh LinkedIn sales if you want to do some analysis of some social networking uh you know feeds that also you can import. Then other miscellaneous are also there. Web based, hive, R script, Python script if there is something to import, get data from uh Google sheets like we saw one example in our video right now. So there are multiple options available.
Now once you have imported the data which is relevant to you um in our subsequent sessions we will see how to create relationships but just giving you a glimpse that whatever data you are importing PowerBI auto detect certain relationships and it'll create for you but then you can go and manually also change. So this is the composite data model which is getting created in the back end while you are importing the data. You can easily go and manage these relationships either keep them as is, you can delete and create new ones manually. So there is no limitation in that. So this is what we have witnessed. We have imported data from different files types, data types and then you know we have tried to once it is imported into uh PowerBI then there is no limitation of how you use it. You can create visualizations across different data sets and then create your standard reports. So this is the example of importing data from web, importing data from a database, from a PDF and then once you have data, you can shape and combine data. You can basically do what whatever transformation you want to do. You want to uh make joins, merge the data. So for example, if we go back to our PowerBI and if I go back to my transform data section. Now as I have now different data sets available with me, I have I can do any kind of u you know operation transformation on the data, right? Uh so like I showed you I uh upgraded the header row because one of the imported data was not showing the header correctly. uh or this columns like this exact one column is extra. I can remove the column, right? All those transformations, whatever I do in the back end gets captured in the applied steps section, right? This is the customer data. You can create uh you can merge it, you can append it uh you know with other data set, right? Let's for example, I want to create a merge data set of my categories and subcategories. So I can say mer select these two data sets and say merge queries as new and I can select product categories and product subcategories. Select product category key on both the sides and then take do a left auto jog jog jog jog jog jog jog jog jog jog join. So whatever product categories are there, I'll get the subcategories associated with it and I'll create a new table which will have now I have the table which has the category and the subcategory and subcategory in one table itself. So I can rename it now to as category subcategory table. It's a it's a merge. Basically, it's a join between category and subcategory. And now I have a common table, right? And I can close and apply. So imagine I have created a new table which is imported created from one data set is which is Excel based and another data set which is text based. See this category subcategory table. So now I can use it the way I want in my visualization reports. So that's what the presentation says, right? That once you have uh the imported data, you can shape, you can combine, you can adjust, you can do whatever transformation you want to do and create your visualization.
What is PowerBI? It is a business intelligence tool to visualize your data and share insights across your organization. So when we talk about BI, it came into existence as a self-service BI tool and it does have different components which can be used. Now before we get into details of PowerBI, let's understand what are the different components or what are the different ways in which you can work on your PowerBI. Now one of the main challenges when it comes to organizations or users is that data is scattered in different places. It might be in different formats and anyone everyone would want to use that data to basically perform some calculations create visualizations or dashboards which could be interactive and that's where they would want to bring all the data in one place might be transform it so that you can filter out and not load huge amount of data in your system and you can work on selective data. So when it comes to PowerBI, it helps us in ETL, it helps us in data modeling, it helps in data storage and reporting. So what are the benefits of PowerBI? Here are some of the benefits. So extract intelligence rapidly and accurately. So that's basically transforming your enterprise data into rich visuals and accurate reports for enhanced decision making. Now one thing we already know that when we talk about data data in raw format might have lot of hidden information. If we look at different data sets which I'll show you in the process, it might have lot of meaning but then the real meaning comes out of the data if we can create visualizations, if we can create relationships between different data sets and thus that can help us in enhanced decision making. Now PowerBI supports advanced data services. It integrates seamlessly with advanced cloud services like Cortana to provide results for the verbal data queries as well. When you talk about seamlessly integrating with existing applications, that's one more benefit of PowerBI. So, it adopts analytics and reporting capabilities easily to embed interactive visuals quickly in your applications. You can build rich personalized dashboards. So it basically provides a unified user experience with customized dashboard and reports that meet your exact needs. It also has a way where you can have secure way of publishing your reports. So you can set up automatic data refresh and rapidly publish reports allowing multiple users to avail the latest information across your organization or across your working community. So PowerBI can connect to different sources. We'll see that in a while. So basically you have an option which says get data and that basically opens up a window where you can find different type of data sources such as Excel, your CSV or text, JSON, PDF, getting data from databases or directly accessing data from databases.
Now before we get further into understanding how PowerBI looks like, it would be good idea to share information and how you can set that up on your machine. So when it comes to your PowerBI and let me open up a notepad here. So for example, I bring up a notepad. Let's say when you talk about your PowerBI components. So you basically have PowerBI desktop and that's mainly your playground or that's mainly used for any kind of development activities. You have your PowerBI server or you can say service. Now, this one is where you would make reports online and share or make them [Music] available to different views. Now, that's one more component of PowerBI. And then you also have your PowerBI mobile which is mainly for viewing the information or I would say viewing reports. So these are the three main components. We can also look at the licensing information of these. So these are the main. So PowerBI desktop is something which you can set up on your laptop or on your machine. PowerBI server is where you can log in with your user ID and password. and PowerBI mobile is mainly to view your reports. Now, how do you set this up before you can explore or start working on PowerBI? So, here is a link which you can basically use. So, if you look into this, so this one basically says service self-service sign up for PowerBI. It says sign up of PowerBI service as an individual. Normally when you would want to use PowerBI you can use a website called HTTP and then you have basically app and let's say I think it's called app powerbi.com. Now this is the place where you can basically log in. Now if you see here I have created an account and if you look at my account it says auatl.onicrosoft.com. Now how do you get this kind of email? Because when you talk about PowerBI it will expect you to have a official ID and it does not take ids which are from common domains such as Google or Yahoo and so on. So this particular link gives you an idea how you can do that. So basically you have what is PowerBI basic explanation on that. It says signing up for PowerBI service. So PowerBI desktop it's a totally free download and then you have mobile apps also a totally free download. And here it says that what kind of email addresses it supports. And if you look into this, you have to either sign up because that does not accept your private email ids or you can go for this one which says enroll US government organization and this is where you can basically sign up for powerbi. So it basically says try free if you go to the website say powerbi.microsoft.com or you could go into this one which I was saying http slash app dot your powerbi.com and this is what you can use or as mentioned you can go to powerbi.microsoft.com for example if I open this in a different tab it takes me to powerbi microsoft I can say start free I can click on this it says try free but then when it asks you to sign in this is where some of us face problem because it does not take your private email ID. Now, how do you tackle that? What you can do here is on this page which says learn about alternate ways to sign up. You can basically open up this link and in this link it says sign up for PowerBI with a new Microsoft 365 trial account and what you can do is you can basically click on this link which takes you to the Office 365 and what you can do here is you can search for something which says say 365 E3 and here you have tried it for free. So in my case it is translating. Okay. So here you have an option which says try it for free. Click on this one and then basically go ahead with your sign up process. Now once you do that you can basically create an account or give a email ID. So it asks you to give an email ID to check if you already have an account and once you do that it will guide you through the process where you can create an account like I have done. Now once you have done that so for example we can go into my this page which I said http/app powerbi.com. Now once you have created an account you would be asked to login. Now I can click and login here and then basically given my password and once I do that it takes me to the powerbi server or service. Now on the top right it might say that go for a trial version. I have already selected that and this is a prot trial which is giving me validity for 60 days. So this is the service which I can use. Now what it means is I can be using my PowerBI desktop which would be also installed. So once you log into this page, you can basically click on apps. You can basically search for something like PowerBI and that will show up an app and you can install and download on your machine. Now once that is there you can basically bring it up. So for example in my case I can just
Say Power BI Desktop, and that's the app which I have installed on my machine and basically that comes up. So that's your Power BI Desktop which is coming up, and it will still ask you to sign in so that you can share your information through Power BI. So you see here on the top, I'm already signed in, and here it also shows you some tutorials and videos which basically helps you in getting to know something more or what's new. So you can always browse that.
So you would have your Power BI Desktop which would be set up. You would also have your Power BI service which would be running, and then basically whatever you have developed on your Power BI Desktop, you can share that through the Power BI service.
Now, usually when you talk about licensing, I can give you brief insights here. So you basically have your Power BI service as I said, licensing. So you have the pro version, which is basically uh your $9.9 per user per month, and basically it has some kind of limitations. So it has, say, max 10 GBTE. You can work on uh some features like incremental refresh is not allowed. You can always look onto the Microsoft website for more details, and in those kind of cases, you usually go for the premium account if you are an extensive user, and premium account basically is conditional based. So it depends on your requirements, and then basically you pay for the service what you use. So that's mainly about your servicing.
Now, when you talk about your server and service, as I said, it is basically making your reports online and sharing and making them available to different BUS. So that is the highlight. So when you talk about sharing reports, that's one of the things; you have anomaly detection; that's also possible here; you can talk about automation of reports; you have security that is you can go for role-based or role-level based kind of security implementation, and all those are some of the features of your Power BI server and service. So it is good to know and basically have your desktop and Power BI service set up.
Now, once you have that, then you basically have your Power BI. Now, when you talk about your Power BI, it basically helps you with various things. So this is how easily you can have it set up, and then basically you can explore this. So, for example, as I was saying, Power BI can connect to different data sources. Now I do have an option here which says Get Data. I can click on this, and that shows me all the different data sources. I can even click on More, if I am interested in looking what more Power BI Desktop tool helps me to do. So it shows me all the different ways in which you can get the data. You see here the server, so the database services, your folders, your different formats. You can click on file formats or databases. You can look at Power Platform. So if basically you are connecting to a platform and getting some services, you can connect to the cloud, that is Azure. You have online services, and then you have other options. So these are all the ways in which you can get your data.
When you talk about visualizations, you see a lot of visualization options here which can be used once your data is loaded. And I will explore and explain more about this. So you have something called as Insert, wherein you can go in for different visuals or different types. You can also get into, say, Transform the data. Now that basically is going to pop up and bring a Power Query editor. Now that's where a lot of your ETL works happen. So when you when you do a Transform data, it opens up Power Query editor which we can use to transform the data or change the data or modify the data as per our requirement before loading all of it into our Power BI.
So you also have an option here which says Modeling, wherein we can create new tables or we can work on our data where we can manage relationships. So as of now, we don't have any data. So it does not show this one as activated, but that can be activated. This is where you can view your reports. So this is in short exploring your Power BI. We'll see what are the different options which we can use here. So it basically supports different kinds of data.
So when we look at the visualization pane, that basically allows us to create different kinds of visualizations here, and we will understand that. So you can basically visualize on your different data and create different kinds of charts, graphs, maps, and basically derive insights from your data.
Now, when you talk about data models, that's where you can basically establish relationships. So when you talk about data models, it is basically used to connect multiple data sources to build a relationship. Now we might have different data sets, or we might have data coming in from different tables where we may want to basically get insights or get data from multiple data sources for our purpose. Now, in that case, data models do help us.
So, for example, if you have two tables, let's look at the standard tables. So you have products lookup table, and you also have the sales table. Now usually what you have in any kind of scenario is if we basically say you have your data tables. So that's basically where your data resides, and then you have series of your lookup tables. So usually you might have, say, your data tables here, and this is what I'm talking about which might have some data; for example, let's say sales is one of them; you might have some other data table which might be, for example, let's say budget table or might be something else, and these are your data tables. Now at the other end, you might have your lookup tables. So basically you have various lookup tables, and these lookup tables, for example, let's say this one is customer, this one is territory, let's say this is product, and let's say this one is a calendar. So these are basically my lookup tables.
So we can basically, as I said, your data might be coming in from different sources. Let's say database or let's say some kind of files or let's say some kind of systems what you have. So your data might be coming in from different places. Now you might want to transform the data. So this is where I could say there is your query editor which I was explaining. So you have your query editor which basically allows you to edit the data table or basically allows you to edit the data before it is loaded. Right? You can hide a column, you can add a new column, you can modify your column. So your query editors would be basically used to work on the data which goes into your data tables.
Now you might have a lot of lookup tables, as I said. So let's say these are my lookup tables, and these are my data tables. So what we need is sometimes we need information based on our lookup tables and data tables. Now that's where data modeling comes into picture. So basically if I would want to extract information from here, so I can notice that there is a product key here and there is a product key here. Now this is where we are already talking about, say, foreign keys or we are talking about your relationships. Right? Now when you talk about relational databases, you have something called as foreign key constraints which is in in Power BI terms I would say it's not exactly a constraint but it is more of a filter propagation instead which is used to basically connect your different data sources, and you could have basically cross filter directions; you can go for single or one to one or one to many or many to many kind of relationships. scripts which basically allows you to work on the data. So we will learn more about data models when we are doing a quick demo there where we can talk a little bit about normalization and denormalization, the way the data exists, right, and then you basically would want to gather insights from your data.
So when you talk about your two data sources as I said, so you have a products lookup table, you have a sales table. Now if you would want to calculate the total order quantity of each product name which is we are talking about the order quantity as information here, and you have product name here. Now how do you get that information? What we see here is we would want something like this, or we would want more information. So how do we do that? So what we can do is the order quantity for each product is basically showing us the same value. Now this is because the product and sales tables are not connected, and there is no relationship between them. Even if you would want to take two sources and just get information out of them, Power BI would complain that there is no relationship established between them. So what we do is we create a data model. So what we do is we build a relationship between both the tables using a common key column which exists in both cases. As I said, there is a product key here. There is a product key here. So that basically allows us to have a relationship between these two. Now that could be one to one. This could also be related to other tables. So it could be one to many. You could have many to one. So all those relationships are possible. So product key is basically used to create a relationship. You see the arrow mark, and then there is also this star which can basically mean one to many. Now when the product key is used to join these two tables or form a relationship, then we can look at the product names and the order quantities which basically gives me a total. Now that's the basic use of your data models.
Now what about this DAX? So basically data analysis expressions. Now that's a a library of functions and operators that can be combined to build formulas and expressions in Power BI Desktop. Usually when we work on our data sources when we would want to connect them, it automatically shows us these data analysis expressions. However, this gives us extension. It basically gives us more power to work on our data. Now sometimes instead of working on DAX or DAX expressions, it would be good to go for better data modeling and have the relationships established better. And sometimes when the relationships are established, you could use your DAX which basically gives you more power on working on your data. So your values are calculated based on information from each row of a table. It appends values to each row in a table and stores them in the model. It increases the file size. So that's what happens. Now you can right-click on any column to add a new column. And for example in this one, it shows that there was a quantity type calculated column which was based on the calculation. What we see here on the top in the in the expression bar which says what kind of calculation was performed, and that basically gives us the value for quantity type, and that is basically added here to our existing data. So that's the power of DAX and Power BI.
So you also have something called as uh measures. So DAX allows you to create new calculated columns and measures. So basically here if you see we are working on AW sales, and then we have selected quantity sold, and what we are looking in the report is we can basically right-click on any table name to add a new measure here. So we have added what we call as quantity sold as the measure. So values are calculated based on information from any filters in the report. We will see this how this can be done, and that basically here the measure does not increase the file size. It does not create new data in the table themselves in comparison to what we were seeing earlier, that is your calculated columns. So these are your type of DAX functions. So DAX allows you to create new calculated columns and measures. So you have date and time which basically allows you to work on date and time data or fields. You have logical functions which allow us to create new filters or add more filters to our data. You have text functions which basically allows us to say transform the data into a lower case or an upper case or basically get the length of a string or concatenate two fields or basically uh do a filtering based on some criterias or replacing some content. You also have statistical functions which can be used. You have information functions which can be used. So these are different types of DAX functions which we can use in Power BI.
So we will learn more on Power BI through a quick demo where we can use some data sets, and those data sets could be found on the internet, although I can also upload that on a GitHub link, and you will have access to those data sets. So let's learn about Power BI through a quick demo by uploading some data sets and playing with those data sets. Let's look at a sample data set and let's upload it, and as I explained while uploading, let's also transform the data so that we can have selective fields or selected data loaded here instead of loading the complete data set. And then let's see how we can visualize this or how we can use the information in this data set.
Now what we can do here is we can click on Get Data, and then we can choose one of the data formats which we would be looking for. So, for example, I can go for Excel and basically click on this. Now here are some of my data sets. So let's look into the folder here, and these data sets are also available on my GitHub link which I'll share with you later. So here we have something called a superstore. Let's click on this, and here I already have a data set which is Global Superstore, or I also have selective data. So let's select this one. Click on Open. Now that's basically connecting to my data source, and that will show me what does that Excel sheet have. So it has different tabs which is Orders, People, and Returns. So let's select Orders. And that basically gives me a preview of the data which I have. And if you scroll all the way to right, it shows me City, State, and then Country. And if you see here, we do see information of all the countries. Now this can be a huge amount of data which may which we would want look into. But say, for example, my use case is that I'm interested in looking for the data for United States and uh as a country and all its states. So we will do that when we do a transform.
Now we can also select the Returns tab, and that shows me these three fields. However, the first row should have been the heading of this uh particular data set, and we will transform that. Now I can go ahead and click on Load, but that will load all the data. So instead of that, let's go for transforming. So let's click on Transform data. Now once you do that, it brings you your toolkit. That brings you your Power Query editor which allows you to transform your data. So, for example, we have uh data from Returns tab or Returns data source as you see here. So we see Column 1, Column 2, and Column 3, and that also shows the type of the data here. It also gives me a quick small option here. Let's select this, and then I can say Use First Row as Header. Now there are various other options which you can do. You can add a custom column. You can add column with examples. You can keep the top rows. You can remove the top rows. You can keep errors, keep duplicates. So there are different ways, and you can also do a merge query or append query. So as of now, let's just say Use First Row as Headers, and that basically shows that now my first row has become the header. You also see in the Applied Steps, it basically tells me if I have changed the type of the data, if I have made any other changes, those steps will get added here. So it basically shows me the name as it Returns. It shows me Applied Steps where I have changed the type, and now I basically have this information. Now this is something where you can change the type or you can basically set it to a particular format. However, we are not doing anything of that sort right now. So we can do that for any of these columns. So this looks good.
When it comes to Orders, let's click on this. And as I said, I would be interested in selecting for Country as United States only. And let me just work on that data. However, we can work on all the data. So let me scroll all the way to right, and here I have the Country. Now there are these filters which we can use. So basically I can click on this, and that shows me all the countries are selected. Now there is also something called as text filters which we will see how we can use to select particular data. I basically have other ways of filtering the data. So, for example, now I will just uncheck this Select All, and what I would be interested is in United States. So let's type it here; that shows me has an option here. Select this, and then basically say OK. So that should basically now filter out, and it shows me the data is United States only, and then you have different states, and the rest of the data remains. So if you look at the Applied Steps, it tells me that there are filtered rows. Now we have done the basic transformation for this data set on these two data sources, that is Orders and Returns. So here you have an option which says Close and Apply. So close the query editor window and apply any pending changes. You can click on this, and it says Apply. So, for example, I can just say Apply for now, and that should basically apply the changes which I have performed using my query editor, that is I have transformed the data so that I can have selective data uploaded in my Power BI. Now it's doing that; it shows me it is working on both of these data sources, that is Orders and Returns. So that's done, and now basically if there are any other pending changes, we can just do a Close and Apply. So that basically has closed, and now you would see the data appearing here. So I have uploaded the data as per my preferences.
Now if you click on the Data tab here. So it basically shows you your data fields. It might take some time to populate, but if you see in the Country field, now if even if I click on the filter, it just shows me United States. Now that's what we wanted. So we have already uploaded this data in Orders. You can always expand the option here which shows me all the fields which are there in this might be this is an aggregation might be that's an ordered date. So this is again some kind of aggregation. So we can change the data types. So we are looking at all the fields in my Orders table or basically coming from the Orders data source. I also have Returns which shows me three fields, and that shows me the data which is returned order ID and region. So the column names are applied correctly as we want, and that basically looks fine.
Now we can also look at your model. So when you click on Model, it shows me these two. However, there is no as of now relationship established between them. So it says under Properties, select one or more model objects to set their properties. So right now these are not related. There is no relationship established between them. So if I would want some data which relates to Orders and Returns, then that would fail because it would say there is no relationship. Now I can go to the first option which says Report, and we have not created any report here. Although we can create a simple report. We can look at the data. So we have our Orders field. Now we can basically pull out some information from here. We can choose what kind of report we may want to create. So, for example, let's go for uh the Table option from visualizations. You have various options here which we can use. This is where you can do a formatting. This is where you can select the fields. This is where you can search and filter out the data. You can also add data fields here. So first let's click on Table, and that basically gives me a table. Now this table as of now does not have anything. So you can use the filter and slices option here which will affect the visualization, or basically what you can do is now since we have Orders here. So this is my Orders, and I would like to work on this. So let's say, for example, Country is I can select Country as a field, and if you say it shows me Country is all as of now, and it says the value is United States. What I can also do is I'm interested in the States. So I have State; now I
Can basically drag and drop it here, and then the state gets added here. So I can basically say select all, and that should basically take care of my state field being added here. So state is all; country is all. Now we can basically look at something else. So maybe let's choose sales, and I can just drag and drop sales here. So that basically says if you would want to have any kind of advanced filtering which says filter type, so go for advanced filtering is less than or equal, or you can also go for advanced filters. So that's fine as of now. So we have added some fields here, and that's basically my data here.
So let's go for filters here, which basically should select all my fields. Now if you see the visualization shows my country, sales, and state which we had either by selecting the fields and dropping them here, or you can in this section where it says fields. So you can, for example, let me show it again. So I can just delete this. I can click on the table option. I can just drag it here. I can basically make it bigger. And I need to add data to this one. So it says add data fields here. So now let's say country is what we are interested in. We are also interested in states. So let's drop that here. And let's say sales. So this is also what I'm interested in. So I'm looking at one specific country. I'm looking at sales per state, and when we look at sales, it basically tells me that this is a summation. So you will basically get the total sales which have happened.
Now we are looking at this data here. We can always go to formatting. We can click on grid. We can basically increase the font here. We can change the grid color. So, for example, let's make it, for example, blue. So I can just select this, and it should basically allow me to have the grid color as blue. Now I can go in for the grid thickness. I can go for row padding, outline color. So we can basically make it a little bit more readable. And then we can basically increase the font size here to look at the information. And you have other options here. So what would you want to do with column headers? So I can basically have the font color. Background color is fine. Do you want to have an outline? Do you want to have a change in font? What is the text size? Might be we can make the heading a little bigger. And then basically you also have the field formatting. So all those could be done. You could go for background, and all these things can be done in formatting.
So now we already have our data here, and this basically looks good, and this is basically one of my visuals which I have here, and this has given me some information for sales, and basically I can scroll this. I can also make it bigger. So I could select a particular field if I'm more interested in looking at the information for a particular state. Now I can add more fields to this. So this is my one of the reports which I have created. Now what I can do with this report is I can basically have more data fields. I can add filters to this. I can basically look into all the data here by just clicking somewhere in the grid, but somewhere outside if you select a particular row, then that data shows up here; you have an option of focus mode which you can go for; you can look at the other options which says export data. Now if this is the data which you are interested in, you can export it. You can always do show as a table if you're interested in. You can do a sort by country, sales, or state. So, for example, let's do a sorting by state. And that basically gives me the data which has been sorted by state information. Now we could obviously have the information here. So I can then change the order. So it shows me alphabetically. This is the information which I have. So I've created a simple visualization using the data which I have, and what I can do is I can click on save.
So that basically asks me to save this as a PowerBI file which has an extension of PBIX, and I can basically call it my report. So let's say first report, and here I can say country, or I can say statewise sales in USA, let's say USA, and that basically is my first report. Now once you have saved this report, you can always look on your machine. For example, if I go in here and if I go into this folder, might be I should look on desktop, and this is where I should have saved it. So it shows me first report statewise that will open up in PowerBI, and we have created a simple report which we have basically used by taking our data. Now I can also do is I can publish this if I would want to share this information. So publish this report online in PowerBI service. You can basically select your report what we have here, and I clicked on publish. So it says what's the destination. So you can have different workspaces. I will choose the default. That's my workspace. I can click on select. Now it says publishing first report statewide sales in USA to PowerBI. You can create a portrait view of your report, and you can do all that stuff. So let it publish, and then we can basically look into our PowerBI server, that's our service where the information is already shared or published I would say, which can then be shared with different resources.
So we can come here, and basically I can look into the PowerBI, and this is where I will be able to look into my workspaces, and let's look in my workspace. So it says this is the place where I had initially downloaded PowerBI data set. It says your data set is ready. Let PowerBI help you explore your data. Right? So you can always do this. You can click on view data set which basically allows you to bring out your workspace and first report state wise sales. Now that's the report which we have published. So let's first check in our desktop if that's done. So it says success open first report in PowerBI. Now I can click on this one straight away, and that takes me to my service. Now once it takes me to the service, it shows me the report which we created which we published, and it basically has the option where I can save it as a a different copy or give a different name. I can embed this in in a website or a portal. I can publish to web embed this report for public access by anyone on the internet. We can do that. We can export it to PowerPoint. So we can do all these options. You also have an option of view where you can change the view. You can basically also edit report here. So you can do that if you are interested in something specific. You can do a sharing to teams. So if you have your teams or groups set up, you can share it with them. You have an option of common panes. You can basically view usage metrics report. Now that can be some sometimes helpful. You can basically go ahead and go and subscribe a particular report. So if there are new changes made, you will be the one who will be informed. You can click on share.
Now if I click on share here from my service, it says only users with PowerBI Pro will have access to this report. Recipients will have the same access as you unless role level security on the data set further restricts them. So I can grant access, and this is where I will have to give the email ids of the people with a message that I would want to have them look at this report. Right? You can also allow recipients to build new content using the underlying data sets, and you can send an email notification to the users. As of now I don't have any other groups, so I'll not be sharing it, but I have created a simple report. Now let's also look at edit report. Let's just to see what it helps us. And when you click on edit report, it basically brings up this one which says your file view. It gives you the filters. It basically allows you to add data fields to this. So it is basically giving access to these data sets which were in my desktop. It is basically allowing you to give or create different visualizations. Now here we have the data which we are looking at, and if say for example somebody is interested in filtering the data, so you could do that. So you could click on filter here, and that basically applies this is the filter we have now country is fine sales might be I can click on sales, and I would say okay let's look at sales which is more than a particular amount, so we can say is greater than and might be I can give a number here, so I can say 30,000, and basically I can say apply apply filter. So right now I'm applying filter, and I would look at the values which also shows me the total value is changed. So you have not only created a report, you have published it, and now from the service you can edit it. So I'm looking at particular data here, and then basically I can click on file, and I can save it, or I can say save a copy of the report, and let's say I will call it the same name. So I'll say first report state wise sales and I will say modified. So let's do a save, and the report has been saved. So now you're looking at the data here. So that is basically giving you information.
So when I click on my workspace here, I can click on reports, and that does show me my previous report. It shows me the modified report. It gives me an option of looking at the usage metrics report. So say for example you want to click on this one, and it will basically give you the usage metrics. So let's click on this one, and that basically shows me the report usage metrics which is generated. So views per day, unique viewers per day. You would want to look at the different platforms, who was using it, views by user, and this can be sometimes useful if we would want to look into this one. Now I can go back to my workspace. I can click on reports, and that basically took me to usage metrics. I could be sharing it. I can analyze in Excel. I can look for quick insights based on this data what we have. You can basically look at the related information. You can also look at the settings of this one. And basically this is how you have your data report here. Now that also shows me the data sets option. So which basically gives me the data sets which can be used to create further reports, and we have our data here. So for example if I click on create report, it basically gives me these data sets, and we can continue working on this. So this is how I have a simple report created without basically working on two different data sources, but I have selected some data here, and then I can basically add details to this.
So for example now if we look at orders and say for example this is the data I have, and say you would want to add some fields. So let's go to returns and say for example I would be interested in looking at the the products. So might be what I should do is I should replace the report here instead of country. It would be interesting to look at the product which we have or basically customer ID. So we can look at customer ID. We can look at the order ID which would be interesting to see if there is a particular order, what was the sales which was generated, and if there were any returns which were happening on that. So for example here when I have these let me cut out country as a field, and I will basically take order ID and place it here. So now if you see my data has been easily modified. So I have my order ID, I have sales, and I have statewise information. So you have basically all the information, but this is now order ID state and so on. Now what if I would want to also see based on the order ID if I say I would want the returned field. So for example I would want to take this one and let's drag and drop it here. Now that says cannot display the visual. Now why is that? So if you click on see details that says cannot determine relationships between the fields. So it cannot display the data because PowerBI cannot determine the relationship between two or more fields. And how do we fix that? So for example, if I click on fix this now it says there is a missing relationship between these fields. Use autodetect to search for relationships or create them manually. Now I can click on auto detect which will try to search for fields which exist in both the data sets or basically I can create relationships. So let's click on create relationships, and that basically takes me to this page which says there are no relationships defined from table to table and so on. So I can click on new. Now here it says select the tables and the columns that are related. Now I can say orders. Now those are my fields where you have order ids, and it automatically shows that returns also has an order ID field. Although all the values might not be same, but this is how you can create a relationship, and it says the cardality says many to one. So you can have basically many to one relationship. You are saying cross filter direction is single. So make this relationship active, and it has already helped us basically identifying the field. So I can say okay. So it says now these two tables should be related or should be connected based on order ID. So here we have this, and let's basically say close.
Now once that is done, if you see I have order ID, I have returned, I have sales column, and I have state, and if you see in returned I do have a value of yes which shows this particular order ID had generated some sales and it was for state Alabama and it was returned and the value is yes. So if you scroll down, you basically see all the values. Now we can add different filters where we can say I would want only yes and no. Now this is again an interesting report. So let's go in also into the formatting, and what we can do is we can look at say the grid option if we would want to basically say vertical grid and let's say on, and it says vertical grid color, so let's select this might be I can try doing a black here it puts it in a right nice table format, and that basically looks So you have sales returned and so on. And this is basically the order which I'm seeing here. So for example, if I would want to change the order and if I'm saying okay, I would like to look at sales and returned and so on. So we can be doing that. We can come here and say for example I have sales and returned. Let's try moving the sales column over here. might be state is an information which we would want in the beginning. So let me also move the states all the way here. So it gives me state, it gives me the order ID, sales, and if there was a return which was happening on that particular product. So easily I've modified my report. Now what I can do is I can just save it. And I can do the same thing. So I can publish it. I can basically continue using it, or I can work on a new report. So let's continue learning.
And uh now here we will also see how you can load some data and perform some transformations and basically get multiple results or multiple tables or multiple data sets which can be then further used for reporting. So PowerBI does give you a lot of options. Now here you have an option as we saw earlier that is get data, or what you can do is you have an option where you can create new data also which says enter data. Now this is something which can be easily used if you have relatively less number of fields. So you can basically add more columns here, and you can basically add values. So for example, if I would just call it something like um scientist ID. Okay. And then I can say scientist name. And then basically I can say uh [Music] domain. And then I can say for example let's say year of joining and and I can keep adding the number of columns here. I can delete the columns right and I can give this and I can say country. So that's it. And now we have created these five countries uh sorry five columns which we have given some names, and we can start entering some values. So I can basically say let this scientist ID be 2234. I can give some name. So let's give Peter. Let's say domain and I can say biotechnology. I can give year of joining 2011 and I can say Germany as the country, and I really don't want this particular column. So I can go ahead and delete this. Now I can come here and then I can give something else. So I can say this is scientist ID. I can give John. Let's say this scientist is mainly working in physics. And then I can say 2018 and let's say France and go back here and let's say 4567 and let's say Marie and let's say uh she does her research in uh molecules and let's call it 2001 and let's say Italy. Okay. And you can continue adding datas in this way. Now you can say if the data is already here. So I can say for example no I do not want this particular row. I do not want this particular row. So you can basically keep adding values here. Now you can say edit. So here we have to give some name. So let's say scientist. Okay. And then if you choose edit, it basically brings up your PowerBI editor which allows you to work on these fields if you would want to make some changes. Now we can make some changes here. We can see what are the number of rows. We can basically perform any kind of transactions here. So this one basically tells me what is the data type. So here we see scientist ID, and this clearly tells me this is an integer. However, we will not want to do any kind of computations here. So we can as well change this. So I can just do a right click and I can work on this particular column. What I can also do is I can just click on this, and this tells me that you would want to change it to date time or you want to change it to some number. So I can just say string because we are not going to perform any computation here. So on the ID column so let's say text and I'm changing it. So it says replace current add a new step. So selected column has an existing type conversion. Would you like to replace the existing conversion or preserve the existing? So I will say replace current. And now the data type has been changed. It is of a string. And if you see this step has got added here. So it says that the change type is the kind of transformation we did here. So that's fine. Now what we can also do is we have the scientist name, but we don't like the column name here. So it would be good to change this. So there is something called as remove or remove columns and so on. So when you do a right click it gives you a lot of options in applying filters or doing some transformation. If I just click on this one. So what I can do is I can look at the date time and let's go here. So we have an option which says do you want to change the type? Now we could have done that here or like I said you could choose the time and do it. You can just say transform and how do you want to change it. So do you want to change it to uppercase? Well you can do that and changes all the values of this one. What I can do is I can again do a right click and I can choose basically if you would want to clean up the data or if you would want to convert to lower case you want to capitalize each word. So let's choose that. And if you see here the steps are getting added. Now to undo any particular step if I just cancel this then I'm back to this. If I cancel this I'm back to my original form. So you can anytime undo your changes and you can basically work on this. So we are working on this particular column. Now there are various
Other options that you can look at. So, for example, these are this is some of my data, but it does not have much information. It would be good to load some bigger data set and then use these transformations, or basically working on changing the data types as I mentioned, or if you would want to do a filtering and remove certain fields and only select particular fields, if that's what you're interested in. Doing a right click where I want to create a copy of this, and then basically I can use that particular copy. Now, what I can also do is I can add column from examples. I can duplicate column, and then I can make some changes to that. So this is my duplicate column. And say, for example, you would want um this one to be changed. So we can say remove duplicates. We can basically, if you're doing some kind of change, you want to change the format here, you can do that. You can use for other things like filling up and all that. Now I can just call it rename and let's say um alias scientist name, right, and I can continue adding columns, or I can do some transformations. And once you have done with these transactions, now this one, if you see, it shows as integer, but is it an integer? No, this is an date format. So I can go for modeling and change the formats.
What I can also do is I can select this, and it says it's not a decimal. It's not a fixed decimal. It is date time. It is date. It is date time and time zone, right? And you can select any one of these. So, for example, let's make it date, which makes it more meaningful. But then what happens is when you do this, it is going for the default dates or the older dates. So I don't like that. So what we will have to do is we will have to basically transform this. And here we have transform, you have change type. So you have date and time, you have date, you have time. So let's choose date and time. And if you see here, it gives me some default timing based on these values, which we do not like. So again, filter it out. But what we can do is we can just make sure that this is changed, or you want to make it a string because we are not going to do any computation here. So I can keep it as date. But then if I have more fields like month and days and so on, then you can do that. So here it also has the option. So when you have selected this, you have an option called transform and transpose uh sorry, transform also has various options which allow you to work on these. Do you want to do some scientific calculations? Do you want to work on the date field? So as of now it is just integer. So we can use one of these. We can do a group by. But obviously we don't have much data here. So as of now let us retain this. I can just change this to text, and that's okay because we are going to look at this later. We can add more data and work on it.
So as of now, once we have done all these changes, you can go back to say home, and here you have close and apply, and I can basically say close and apply. So the changes will be applied, and then my new table which we just created by entering some random data, performing some basic transformations, will be available. So if you look into this one, so that's where my data is. It shows me the columns, but there is no aggregated column as such here. You don't see any summation mark. You just see the field names or the column names. You see the values. Now, obviously, if you go into modeling, there is no or there is no existence of a different table which you can join these tables, or you can perform some transactions. Come back to the data set. So this looks good, and we have it here. Now, obviously, we have not created any visualization based on this which we can, and we can continue working on it. So over here, this is my data set which is a small table where we have created some data, and we can use it anytime.
Now let's work on a bigger data set and see what kind of transformations we can do. We can then also see on modeling, or basically using some smarter ways of working with the data. So what we would want to do is we would want to load some data here. So let's go [Music] into sorry, let's go into home, let's go to get data, let's use our old store data, and I'm going to take the global supertore which is huge data set with all the countries and the products and the sales which have happened, and we can take this data, but before loading it as I suggested earlier, we should basically transform the data, we should basically transform the data so that you don't end uploading everything and you don't work on all the data. I mean, unless you really want to. So here I will this Excel sheet which I'm talking about has two different tabs. We have used it before. So let's use orders. Let's use returns, and that basically shows me the data what we have. So I can do a load, but that's not what we would want to do. So you can do a load, and you can get all the data, but let's go to transform, make some basic transformations before we load the data. So our powerbi editor allows us to work on this. Now here we have it says this preview may be up to 9 days old. So I can do a refresh. I can select this, and I say first thing is use first row as header because that's what I want. So it is basically setting the first row as header which looks good. And we have some order ids. We have the returned if the product was returned. So let's look at the filter here. So it just has yes values which we are looking at. So it says list may be incomplete. Let's say load more. And let's see what are the filters here. So either there might be a product which is returned, or it might be blank field. So that is chosen. So that's fine. We have order ID. We have region which is basically showing me different regions here. Let's look at orders. And orders is again having your row ID, order ID, order date, ship date, ship mode. So you have quite large amount of data here for your different countries. Now in earlier example I chose United States and then I was only focusing on the states and city in United States. So we can do that. Now I can basically work on refresh. So whatever preview was stored in the memory we are just refreshing it. Now here we have this row ID, and if you see the row ID is an integer. Obviously we will not be performing any kind of computation here. So here you don't have any row ID, but here we have row id. So let's make it uh from integer let's make it string, and I'll say replace current. So that's that looks fine. It's a row ID which we will use to search, but we are not going to perform any computations unless you want to find on an average on row ID or anything else.
Now you have order ids. So what we can do is we can filter some values. We can rename the field as we desired, right? So, for example, let's go in here, and what we can do is let's go into uh customer ID ship. Okay. And here you have say state, you have region. Okay. Now at any point of time if I would want to filter out the values, the easier option is that you can select on this one, and here you can do some text filtering, okay, or you can basically select the values from here, so for example, if I say let's get rid of select all, what we will be interested in uh say United States and UK, that's the data we want. And then I can basically say okay. So it is basically going to filter out the data which is for United States and UK as of now. Now what we can also do is how about doing some more filtering before we basically work on this. So let's go in here, and we are looking at United States and UK related data, and let's look at it is sometimes good that you can basically uh work on the data here. So, for example, I go into orders. Now what I would want to do is I would want to look at the fields. Okay. And we want to we have not yet loaded the data. So if you look in the background, I just have my scientists because we have not applied these changes, we have not loaded, we are still in the transformation stage right now. What we can do is let's go for so we can do segment and all these kind of fields can be used for grouping the data. So we will see that whenever you have a data set, you would already know there are certain fields which have repeated values which can be used to group the data, and we can do that, we can change any kind of values which are not going to be computed on. So, for example, I have postal code, I can use this, but again we are not going to find a postal code which is greater than something, right. So integer is not the valid type. Let's change it to text. Okay. And um if, for example, I would want to look at this. So I have done some changes here. Okay. And this shows me null. So, for example, let me just revert this back, and let's make it a whole number. Okay. So there are certain columns or rows which do not have some values, and we can basically get rid of those values. So as of now we can do a filtering here. So let's keep the postal code as integer, or let's change it to text. Do a replace content. And now what we will do is we'll scroll all the way right. Might be I'm interested in technology category. So that's what I'm interested in. So what I can do is here I can do some filtering. So I can basically choose technology. Now the easier way would be since these are categories and there are only three categories, we really don't want to go and apply text filters here. But if you had something like an office supply and um office inventory, then you could have done some text filter. So let's not do some text filtering here. What we can do is I would be interested in technology. So that's the field I'm interested in. So now you are only having data which is related to technology. Okay. And you have some product names. So this is where we want to do some kind of filtering. So we can rename the field. We can select some fields. So let's, for example, let's go for uh any of the field which I think might have more entries here. So, for example, let's go for Canon wireless or Canon image. Right? So let's go for product names, and I will say let's go here. Now I could have done a transformation, but that's not what we want. We want to do some filtering. So let's go to text filter. And here I can say begins with. I can say ends with. I can say contains. So let's go for contains. And it says enter a value here. So you would want to keep the rows where the product name contains something, and it gives you some suggestion, right, so where you are seeing in some values here, so for example, if I would have selected this, then it applies the complete thing, but that's not what I want, so I will get rid of all this, and I will say it contains cannon. Now I can go for advanced filtering also, okay, wherein you can select advanc adanced, and then you can give different columns and what do they contain, what kind of values you're looking for, so you can do that, but we will not go for advanced in one step, let's go for basic, and let's say okay, and now I should get all the products which are canon, and you have different products, so this is one kind of filtering I've done. It tells me what is the category of this, it is machines, it is copy appears, it is obviously belonging to the technology category. We are looking at uh the market which is for this particular data. When you look at the country, we are still focusing on United States and United Kingdom, that kind of data, right. So we have filtered the data. We have done some uh selection based on the data here. And what I can do is I can then basically rename a particular field. So I can do that. I can say I'm interested in um sales which is the data here. We can basically look into the quantity. So sales is something which we are interested in, but might be we are interested in sales which are more than a particular value. I'm not interested in lower amount of sales. I would want to look into United States and UK data, but I am interested in sales, or I'm looking at if the discount percentage was something, or if the profit was more, right. So we can apply different kind of values here. But what we can do is with these changes because you don't want to transform and make changes all here. You want to make the changes once the data set is uploaded. So we have selected some data. We have create done some transformations. We can basically break a particular column into multiple columns if that's what we want. If we see that we will do an aggregation based on year, or we will do a aggregation based on the country or year and order ID, right, so we can break this data into multiple columns, so we can do that, but for now let's do a close and apply, and let's apply this. So that's going to apply all these changes. It's going to load my data. But remember now we are having selective or selected data which gets loaded. So that should get be available here. So it takes time sometimes. So you have to wait, and then you can go ahead and check here. So, for example, now I'm looking in tables. Let's basically minimize this. Let's go for orders, and this is the data I have which obviously row id if you see, so you have all the row ids, and again again you can do filtering here, but this is where you have already loaded the data, the data is available, and then you can start working on the columns here, so we have this if you closely see, we see this summation mark, and this basically means that these are my aggregated column columns or these values are measures which can be used for calculations. So we can see that we can create our own aggregations. So we can do that. We can rename the field as we have seen. We can filter out the data. So we have all the fields showing up from orders. And let's also look at the returns which basically has the columns, the order ID and your region. So it basically shows the region here where was the product returned from, and we have this information. So what we are doing is we when we were doing a text filter in the previous example, remember it was case sensitive. Okay. And you have to take care of when you're doing a text filter, you have to give a field which exactly matches as it exists in the content.
Now, okay, this is the data we have, and let's look at the order column. Right? Now, what we can do is we can do some quick transformations here, and we can basically look for more data here. So, let's say we have uh some filtering to be done. Now, I can do a filtering based on my uh product. So we had all these products, but now let's do a filtering on product, and then products you have copiers, you have machines, so you have mainly two categories, right, and when you look at machines, it basically talks about your PC uh something, so let's look for machines, and here we have basically the copier fields which are more, so I can basically go for filtering here, and that's the data we have. So we don't want to really unselect any of these here. But what I'm doing is I'm saying text filter, and let's go into this one now, and let's say contains. Okay. So I'm saying contains, and then I can basically say uh let's say copier. Now that's what I'm interested in. and uh show rows where product name contains copier. Okay. Now you can give a and condition here. So if you would want a specific copier, if you are interested in okay, let's also say uh contains and let's go for laser also laser and let's say okay. So you see the data gets filtered out here, and uh we have the sales which we are seeing here. So let's go to sales, and we will be interested in anything above 500. So let's go to sales. Let's go for number filters. Let's say greater than, and I will say for example 500. Oh, sorry, 500. Okay. and uh let's say okay, so that basically filters out the data, and then I am also interested in quantity where I would want the quantity to be more than one or more than two, so for example, so let's go in here, and you can basically choose what is the filter you want, so you can apply any number of filters. Now you have the filter ing here. You can always click on the filter, and if you want, you can just do a clear filter, and the filtering will be gone. So you have all the data, right, and this is the particular data we have, and here I have say, for example, product name. Now I can keep the filter because I'm interested only in these values, or I can filter out. So this tells me that when we did a and it is basically going for laser and copier, right, so let's say, for example, clear all filters, the thing is gone. What we can do is let's go here, go for text filters, say contains, and here I will say it can be a copier, okay, or so last time we did a and I'll do a contains laser. So let's choose this. That gives me more entries. So either the product name has copier or it has laser. It has the quantity. It has the product name, and we have all this detail here. Now what we can also do is we can do some transformation on the product ID. So, for example, you have product ID or order ID. So order ID shows up as uh looks like the country name uh the year and then the order ID. So we can basically split it up. So I can select this, and here I have option of let's go to home. So when you have you have selected this column, so you have an option of transform data here. So use the power query editor to connect, prepare and transform the data. So if you really want to transform the data here, if I basically select this, if I just do a right click here. Now here it just tells me do you want a new column? Do you want to create a copy of this column? Okay, you want to create copy table. So this is your transformed data what you have. And for example, let's create a copy table. and let's come in here. So you should be able to see your copy table now. So let's go in and select this one. And what you need to do here is creating a copy of this or copy table would not be the right option. What we can do is we can work on transforming this rather than doing it from here. So you have this option of adding a new column, going for a new measure, renaming it. Right? So that's okay. But what we can do is select this particular column. Let's do a home. And first thing is let's go to transform. So I want to transform the data. Now let's select this one. And it brings up your power editor again. Here we were interested in orders. So we are looking at our data here. Now if you see my countries United States and UK. So you can confirm that. If you look at category it is technology product name has copier and laser as we selected. So those things are retained. So you have not lost any changes as of now. So this order id column what we have now as I said you can be doing a filtering, okay, you can select this particular column and then you have other things which can be used to transform here like you want to change the data type, you want to use first row as header, you want to replace some values, okay, you want to run some merge queries, you want to do some analytics, so all these options are here. Now what we can do is while this column is selected I can do I right click. Now there is an option called transform which is
Basically, going to help me in changing the data here. Okay. Now I can basically duplicate the column. So I really don't want to work on this column itself. But it would be good to have a duplicate column on which we can work on. So I can do a split column here if I would want to. But let's create a duplicate column. So let's say duplicate column. Now that gives me a duplicate column. So we can rename it later. So now I will not work on my original column, but I'll work on a duplicate column. And what I'm going to do is I'm going to basically transform or split this. So again, do a right click. Now you have a split by. So we can say split by by delimiter or by number or by characters or by position. So by lower case and uppercase. So you can do all of this. So let's go for by delimiter. Now if you see it basically identifies the delimiter, which is hyphen or dash. Now you can go for split at leftmost identifier, right, sorry, leftmost delimiter, rightmost, each occurrence of delimiter, and that's what we want to do. You can look into advanced options where it says split into columns. So do you want to split that into columns? Do you want to split that into rows because that's more or less like doing a group by, and you can say number of columns to split into. So we have here 1, 2, 3, 4 values. So that looks good to me. And uh let's do say, for example, if I choose three. So I can choose three and then split using special characters. So you could do that. So let's, for example, let's say okay, and let's look at the data how it looks like. We can anytime delete the data; we can keep it the way we want, right? So what we did was we created a copy of the column, then we did a split, and what we have seen is we just have three columns now. If you see the fourth bit is gone; fourth bit doesn't show up, right, because I just did a three as the resulting column. So I have the order ID. Okay. And we can check if there is already an order ID column. So we have order ID, but that has the complete order ID here and the relatively product ID. So you can see the customer ID. You can look at this one. So it basically has your order ID. And then let's look at the fields here. So we have the product ID which says T C M A. I'm looking at the first one, 3700, and that has in no relation to the order ID. Right? So we can make sure that there is nothing which is conflicting with our entries. Now once that is done, so we have order ID which can be used to categorize the data. You have order ID which is basically the year. Okay. And you have order ID which is basically having some more value. Now I can keep this data as I want. So I can basically click on this. I can go for renaming, and I can say let's say let's call it order id, and let's say ids. So let us, in case there is a particular column and you would want to look at. So just give the name correctly. Now order ids is fine. So here we will also rename this one. So let's call it uh order year, and that's going to be order year. So we can again change this to string. Okay. And here you have the order ID. So let's rename this one. And I have my let's call order number, right? So we have we are seeing all the steps which we have added here. We just split the data based on the delimiter, and we have now three new columns which have got added to our existing data which was already filtered, and we have done some splitting up of data by creating a duplicate and then renaming it. Right? So if you go and look at your transformations. Now if I would have done a split here straight away, then my original column would be gone. But probably we want the original column because sometimes you may want to search order ID which I consolidated information. Sometimes you may want to segregate it based on year. Right now we have the year field or order date field. Here you have the ship date. Right? But then might be you want to just aggregate based on year. You don't want to really spend time in aggregating or extracting the month and day and so on. So my these three columns can be useful. Now what I can also do is I can merge the columns if I want. So we have split the columns, but what I can do is I can say select, select, select. So using your control and now do a right click. So you should have an option called merge columns. Right now this is something which is uh we would want to merge. So let's say merge columns and let's say do you want to keep a separator? So yes, I want to keep a separator, but might be this time I will give my separator is a uh colon, and then what is the merge column name you want to create? So let's call it something like um order. Okay. Uh year and then let's call it numbum. Right. So sometimes renaming the fields to a name which makes more sense or based on your naming convention is good. So let's do a merge. And now what I have done is I have done merging of those columns. So I split the data. I merge the columns. And now if you see my the columns which I had created, those columns are gone because you did a merge. You did a merge. And now you have the fields which are either uh earlier you had something which is separated by a hyphen, and here you have something which is separated by colon. Right now anytime if you want you can unmerge this by removing this step. Right. And you can get rid of this merge columns. So if, for example, I would do that. So I have my data back, right? I have my data back. So what we could have done is we can select this. Okay. And then what we can do is like what we did earlier. So you can basically go for removing the columns. Okay. You can do a merge column. Okay. You can select one by one and create a duplicate of those, and then you can merge them. Right? So all the possible options are there. So you can the best option would be to create a duplicate of these columns and then basically merge them as per your convenience. So might be you can say order ids and order number is the pairing what you want; year is something which you don't want, right, because we already have the date field. So I can basically say remove, and this one is gone. Now I will select this and this, and let's go for merge columns, and I want to give a separator which is might be without the ear, and you have space, or you can go for custom like earlier we had give a symbol, and then what do you want to call it? So let's say order specs. Okay. Right. So this makes more meaning because we already have the date field. So why do I want the year into my order ID? So I can always be doing a segregation now based on order specs. Right now this is some simple transformations. What we are doing here? We are seeing the data which we have. Okay. Now what I can do is I can basically first apply these changes so that all my changes what I have done are applied. Right now once these changes are done, we can basically go ahead and save this file. So I can just say save. I can go for save as. I have different other options. So if you would want to keep performing your transformation, then you can just do this; you can add a column; you can view the data. So for now our transformations are good enough, and what we can do is we can basically go back to home. We can do a close and apply, and we will be back to our data set which has been modified. So we can see if the data what we have has been transformed. So we have order specs here. That's good. We did not do any filtering or uh we have the filter left here which basically tells me that there are these different fields. We have not removed them. But what we are doing is we are just applying a filter to choose copers and laser printers. So that's what we have here, and this is good enough. Now what I can do is once this is done, I can basically save it. So I would want to call it some kind of report if you would want to create. Okay. So let's call it as uh uh let's say second report. And here I will say country and technology specific info. Let's save it. And now basically I have saved my data. So what you can do is you can go for creating other reports or basically having this information published if that's what you want to do. If you want to go for visualization because right now what we are seeing is we have a lot of data here. We have a lot of data here. It shows me there are these uh tables or data sets which we have worked on that shows me here in the models, but there is no relationship with them. If you go into visualization, then you don't have any option or you have not created any visualizations based on this data. But if you go here now based on the data what we transformed, if you see we have order specs, right now that's what we chose; we basically have other fields, so you have ship date; you have aggregated columns which can be used for visualizing, and we can work on this, so I can come back here, and what I would be interested in is this data set is fine, but I want to do some grouping; I want to basically have some selective data in this, and for that what I can do is uh let's go for ship mode. Now this is something what we have, so we are in this data field now; we have this transform, so let's go back to transform again, and let's choose our orders, so that's the data we have, and now if you see here, this is you know, a huge amount of data. What we want is we want to group them based on the shipping mode. So here you have an option called group by. So I can select this. I can go in here. I can basically work on okay, get rid of duplicate values, but that's not what we want to do. You want to do a group by. So as I said, you can do a group by from here, or you can choose from the transform option above, and you can do a group by. So let's do a group by. Now how do you want to group the data? So I'm saying I want to group the data here based on shipping mode or which is the other column you want to use to do a group by. So let's go for shipping mode. And what is the new column name, right? So, we want to basically find out that you want to go for ship mode, but that's not enough. I mean, I can do a ship mode, and I can do a grouping by, but you want to just count the rows. No, that's not what we want to do. So, let's go to advanced. So, ship mode is fine. So, that's your grouping, right? But then what we also want to do is we want to do a grouping based on say sales. So here, for example, let's go for sales. Okay. And what should we call this? So might be we can say uh shipment wise sales, whatever you would want to call. So you can basically get the operation. Do you want to really count the rows? No, we want to basically do a summing, or we want to might be find out an average price, right? So, let's do a sum. Okay. And here I would want to do a summing based on say, for example, sales. So, this is what I'm going to use for getting a count of the sales. Now grouping by might be we will change this instead of [Music] uh instead of sales we are using a ship mode; what we can also do is let's go for a segment, and that would be a valid grouping. So it will take a combination of ship mode, segmenting, group the data based on that, and then get me the sales which is which is basically let's call it shipment wise sales. So it gets a sum. So let's do an okay, and that's my more relevant data which I'm looking at. So I'm looking at the ship mode. I'm looking at what is the segment, and then I'm looking at what is the total sales there. I'm looking at again the ship mode standard and home office. So always remember when you're choosing multiple fields or multiple columns for grouping by, you are basically having a combination of two fields. So that has to be unique, and your grouping is done based on that. So now you're looking at the sales wise, and this is something as an important information what we have. So we have done some transformation, and what you can do is you can use other ways like you can use pivot to get individual values from it. You can run on merge queries which is basically running some merge queries and merge the query with another query in this workbook if you have. So you can go for this. Now I can basically go for apply and close. So just to add to the group by step, what we did was if you see here, I have removed the group by filter which we just did a couple of minutes back, and what I have done is instead of transforming your complete data set, you can basically create a copy of it. So, for example, I can just do a copy, and then I can come here and do a paste, and I have done that, and I'm calling it orders summarized, but this is my complete data. Now what we will do here is we will basically go ahead and do a grouping by again like what we did earlier based on your shipment, based on your segment, and based on the sales. So that's what we are looking for. So let's go for the ship mode, and we go for group by, and here you would want to go for advanced to ship mode, and this one I will go for segment. So that's fine. Now we want the new column name. So let's say shipment wise sales. So I want to do a summing, not the counting of rows, and I want to do a summation based on sales like what we did earlier, and then you say okay, and that basically gives you the data here. Now what we have is we have the resultant data based on the data which is coming in from here. We did the same thing just 1 minute back, but we worked on the original data set. So what I did was I created a copy, and now I'm working on this one. So I'll say close and apply. And now we are back to our desktop. So it is applying these changes where we have done some transformations, we have done some grouping by, and what we can do is once we have the data here, we can anytime look at our data sets or tables. So this is my original one. If you see now I have order summarized. I can just pull out this information. I basically have my returns which we have not really touched, and we have the scientist. So we have all the four data sets here. Now what we can also do is let's look into order summarized, and we just have this data here. So this is fine, and you can continue working on this. You can basically merge columns from two different data sets, and then you can get the merged column, and you can rename it. So you can obviously do that. You can basically do an uncheck whenever you're working on these data sets. So what you can do is if you would want to work on transforming, for example, let's go back here and say I want to do some transformation on it. So how did we do it? We just did a transform, and you can go back to transform. So you have this data here, and the data what you have, you might be interested in transforming this into something else, and then you don't want to maybe load this data. So you have this option where you are selecting orders, and then you have something called as enable load which can be unchecked. So when you do an uncheck, what will happen is whatever changes you perform, only those changes related data set will be loaded, and they will still be available, but this will not affect your it will not affect your original one. So, for example, let's say copy, and let's go in here. I will do a paste. Let's say orders. Oh, I did a paste. I need to rename this. So let's do a renaming. Let's say orders. And here I will say summarized. And I will say US. So I'm renaming it. Now let that get loaded. We can perform some transformations on it. So I have here where's my country? So let's look for country. Yeah. And let's look for country. So here I will go for only United States. Okay. That's what I'm interested in. And then I can choose well, I am interested in just central US. So I can basically go for just the central US, and I can get rid of all of these. So now I should have only central US data, and this is fine, and this is the data might be we are focusing on right now for doing some visualization, might be looking at sales, might be looking at the product names. So you have the product name. Now remember you don't see any filters here, right, because the filters are coming from the resultant set and your transformation. So if you have any filters, you would be seeing in the top row. Now this is the data we have. Let's um let's not restrict it to region. Region would then reduce my data, but that's good enough for us. I can just say no, I'm clearing off this filter. I'm still looking at United States, but I want to look at all the regions. Yeah, whatever we would be interested in category, and that's anyways chosen as technology which we had chosen when we were loading the data. We have copiers and machines, right, and we can basically keep this. Now this is fine. I can apply the changes. I can apply the changes based on this one. And what I can do is I can just say for now apply. So that's going to apply all the changes which you have done in orders or summary or the new one. Right? And what I can do is now I can choose order, and I can say don't enable this in load. So it says disabling load will remove the table from the report, and any visuals that use its columns will be broken. We are not creating any visuals as of now. The table will be removed. So that's fine. And now I will say close and apply. So what happens is you are loading the data based on the changes. Okay. Now you have your order summarized. You have returns. You have scientist. But you basically do not have orders anymore. So that was not loaded. So I only have this one. I only have this one. And you have returns, you have scientist, you don't have the orders column. Right now that particular data set was not loaded at all because we did not choose that to be loaded. Right? Now while I'm in this orders which is let's see here, and actually you can drag in. Yeah. So you have order summary, and this has basically kind of data which I'm looking for. So I really don't need the orders table. So you can do it in steps, and you can aggregate this. You can have aggregated data. You can have all the data which is filtered, transformed, grouped by, and then basically just load it, and the original data set which you used, that's no more being loaded here. Now at any point of time if I really want, I can go back to transform data, and remember it is still here. It is still here. It's not gone. Right? So you can basically select this, and you can say enable load, and you will have the data back which you can continue working on. Right? So these are some quick transformations which really help us in working on the data. Now obviously if you have data you want to perform some left joins, right joins, you have inner joins, outer joins, so you can always do that; you can take two different data sets; might be I'm interested in taking the orders summarized which talks about standard class consumer shipment wise sales, and here if I look at order summary, I have other details, but the thing is we need to make sure that these have the values. These have the values. Say, for example, the
segment column here and the segment column here can really be used to join these two tables. So if I create a relationship, or if I create a join, I can basically merge the data. So this is how you work on data.
We will also see some more examples on might be modeling the data using some expressions to work on the data. So we already looked at creating a report, selecting particular fields and then publishing the report onto your PowerBI service. Now this is the report which we had created which says state, order id, sales, and then I also added this returned field, and that was basically by creating a relationship between order and returns, which we can also have a look in model. So this is the relationship which is created. If you just place your cursor here, it tells me that we have a relationship between order ID of returns and order ID of orders. And that basically allows me to join the data, bring it in my one report.
Now this is basically your data sources you can look at, and if you click on your visualization, so that shows you your report. Now what we can also do is we can make it interesting. Now we would not want to scroll through the fields to see wherever or what was the order or what was the order ID which was returned. Now I can do a sorting. I can filter out. What I can also do is I can use this option which shows slicer here, and that basically allows me to work with this data. So we have this report here, and basically as I said, you can click in here, it shows the data.
Now what I can do is I would want to filter out information or slice the information using your returned either being yes or having a field which has no value. How do we do that? So basically I can drag and drop the returned here as a field which comes from returns. Now that basically shows me only the value as yes. But I do know that there is there are some fields which are blank. Now how do I add filter to this? So I can click on this one, and then I can click on slicer. Now once that does so, it basically pulls out all the different values. So you have either yes or you have the blank field for returned. So what we can do is we can select yes. You will see only the orders and their ids and sales where the products were returned. So that gives me 108,118, and I can select blank. So that will basically get me all the orders or products which were not returned.
Now this is a simple way wherein I can add a filter to or a slicer to my report to basically give viewers a choice of uh selecting different fields, and you can add any number of slicers. You can basically say I would want particular kind of information. So for example, if I go into orders and we know we have the state. Now I do have the state information here, and basically I can, if I would be interested, I could filter this out in my report itself. I can sort it. I can look it in a different order. What I can also do is how about bringing in state here and basically dragging it here. So that gives me the state option. It is giving me a visual which is basically giving me a geographic location of all these points. So yes, that can be good. What I can also do is I can keep this which basically shows me the state map, might be it can be useful. You can zoom in, you can zoom out, you can look at specific information here. You can drag and drop here. So that's fine. What I can also do is I can again take the state and bring it here, and that basically can be instead of my map I can go for slicer. So that gives me all the values here and which basically allows users to choose the fields or the states which you would be interested in looking at. So for example, if somebody is interested in looking at the data for Georgia, just select this one, and you see the map automatically shows you where in the map that's the place, and it shows me all the sales for Georgia state. Now I can also basically select yes, and that shows me which were the orders which were basically returned. So that gives me a quick overview of statewise what is the geographical location if the orders were returned or maybe I can just click on blank, and it shows me the non-returned orders. I can again go here and uncheck the georgie option, and that shows me all the states.
Now once you have done this, this looks like a comprehensive report which can be useful for the viewers, for your management team and so on. So we can just do a save, and that basically is saving my report. So I have this report. Now what if I publish this report? So I can just do a publish, and when I publish it says okay workspace. So let's say select, and then it says replacing this data set may impact two reports. You already have a data set named by this one. View the impact. I would say replace, or I will say view impact. So that basically takes me to the PowerBI service because sometimes we may have some reports which we have already uploaded, and updating an existing report might basically affect my existing report. So it basically shows me the impact analysis. It shows me one workspace. There are two reports. They are they have not been added to dashboard, but these are the ones which will get modified. So let's for example as of now go ahead here and let's look into my PowerBI. So go back to your desktop, and I'll say no, I don't want to replace. So click on cancel. So I do not want to publish it. What might be what I can do is I can try saving it as a different report. So let's say save as. And now I will basically say additional filters. Okay, let's save it. So now you see the name on the top changes to additional filters. And now it's saved to publish this. And now I can go ahead and publish it. Select your workspace. And basically it says this is the report being published with our additional filters with a map which gives a geographical uh area showing us the information. And then basically what I can do is once it is done I can look into my PowerBI service like we did earlier. You can do a filtering. We can basically query this data. We can share it with other users who might be interested in looking at this particular data. Now this says it is done. So it says get quick insights, and might be it's a good an option to look into what kind of insights it's it gives you. So click on that. See the beauty of PowerBI where it tries to search for any kind of insights which it can gather from the kind of report which you have built.
Now once the insights are ready, it will let you know what we can also do is we can come in here, click on view data set. So you see now it shows your additional filters, and here you have option where it should be showing your report. So let's say view, and view is fine. So, and if it doesn't show up, sometimes it might taking taking time for refreshing. So you can always go here, and then you can click on your report, and that should get populated. So this is the report. These are the filters which I have. Gives me an option of choosing all the states and basically allows me to edit the report and look at all the information here. Meanwhile, we can see here it is still trying to gather some insights from the data. And now you see there are some insights here. So it says sales which is coming up, and a subset of your data was analyzed and the following insights were found. So you're looking at sales by ship mode. So it says standard class, second class, first class, and same day. So there were different shipping modes in our data, and that's what it shows me the sales which one had the majority. It shows me the profit. So which city or state had more profit. So New York City has noticeably more profits here, average by shipping cost by subcategories. So there are these different subcategories which we can look at such as copiers and machines have noticeably more shipping cost, profit by product name. And you can basically look at the row ID and quantity. So this is where you're looking at a regression analysis. You're looking at row ID and quantity. So there is a correlation between row ID and quantity. So these are two different variables or fields which are related. You're looking row ID by category, row ID. So it says California has noticeably more row IDs. Sales, your profit, count of region, and count of returns. So there is a correlation again between two different variables. Average of shipping cost. Now we would have taken lot of time in building all these visualizations, but PowerBI has already helped you in gathering all these insights, and then you can basically select which one of these is what you're interested in. You can focus and look for more information based on all the fields it has given you good amount of insights which will help anyone who is looking at this particular report. So that's your quick insights here, and we have this information.
Now once you have this information, this is basically where you have your focus mode. So it says subset of your data was analyzed, following insights were found. You can basically say download, and uh here you have other options which allow you to work with your PowerBI. So let's look at this one. So this is where we have our report, and we can continue exploring it more. One more interesting feature which PowerBI has other than having your insights ready to use which is basically in your workspace and you can basically use these insights. What we are looking at various options here, and basically you have this option where it says spin the visual. If you are interested in a particular insight, you can always pin it which you can always go back and look into. What you can also do is you can also click on edit report here. Now that's a report which has already been published to your PowerBI service, not yet shared, but that can be shared or that can be subscribed. Now once you click on edit report, it has option of reading view, mobile layout. You have basically an option which says basically options for navigating through the data set. You can go for how visuals on the canvas interact with each other. You have all these options, and one of the good options is ask a question. So you can always click on ask a question, and that basically b says some suggestions. Now you can open this, and it says okay, ask a question about your data. Try one of these to get started. What is the average sale? Sort orders by order date. Sort orders by product ID. How many ship modes are there? Compare quantity and discount. So do not worry that your report has only four fields. So it has state, order ID, sales, and returned with some filters. But what about you looking at how many ship modes are there? So it is already looking at your data. So if you click on this one here and you can see what are the different fields what we have, and you have ship date and ship mode. So this is one of the fields which it is showing you to ask a question. Now what you can do is you can say how many ship modes are there. Let's click on that. Let's ask this question. It says four ship modes. And do you want to add this to report? Yes, you can. You can let it be as it is. So you can basically keep this question here. And here you have an option. The visual is showing number of ship modes. When you place your cursor here, if you see here, turn this Q&A result into a standard visual, and let's do that, and basically it is saying number of ship modes, right, so now that's the power of your uh BI powerbi which has basically allowed you to ask a question and quickly add a visual to your report. Now what we can do is we can basically save this. Or you can say save as and give any different name. So maybe I'll just say save because I would want to have this information, and the report is saved. So in this way you can basically not only create smart visuals, you can not only relate different data sources using data models or relationships. You can add maps, you can add filters, you can add quick questions. You can basically just go here and say, for example, you would want to ask a different question. Now we see the fields here. How about looking at the shipping cost? Right? So here I can say um what is the uh highest shipping cost? And that shows me some suggestions. Let's select that. And that shows me the value which is great. And I can keep it as it is. I can basically convert this to a visual. I may want to keep the question because might be this question was asked and uh you would want to see the result here. Might be you can move this somewhere here, and that gives me some kind of question which was asked, and we can do a save, and that's my report which has been saved in my BI service, the data set is still there, you can basically go ahead and share this, how to connect different data sources with powerbi.
So in this session today, we will see how can you connect different type of data types, data sets like Excel, PDF, CSV, etc. to import in PowerBI for your data visualization needs. So what's in it for us today? We will be learning how to connect to data, different data types, data files like Excel, PDF. Then what are the different data importing modes, and then I will also show you practically different sets how to import them in PowerBI and use it for your visualization purpose.
Now what are the steps to connect to data? So now we will go directly into PowerBI and try to import one by one few most commonly and popularly used data sets which are most commonly used uh in a day-to-day activity. Rest of course there are PowerBI supports any number of data sources, uh but we will do something practical on the most popular ones. So let's let's open our PowerBI. Now this is my PowerBI, and first I want to show you that how can I import data directly from a web page and import the data. Now it is asking for a URL in order to import data. So what I have done is I have created a Google Excel sheet with simple data with rows and columns, and what I have done is I have shared this uh sheet as publish to web. Okay. So you just need to say publish to the web the link as web page and say done. It's it's automatically published and say link. So copy the link which you have published on the web. Copy this link and then go back to your Tableau. Paste it link over here and click okay. Now PowerBI will try to establish a connection with this Google doc sheet because it's published on the web. You need to wait for a while while it is reading. Okay, now it has read one of the HTML tables. So I'll select this one. Now you can see it has it is showing me a preview of the table which is there on my Google sheet, right? It has 11 rows. So it has all showed all the 11 rows. So now I can go and transform this data because I can see my headers are there starting from the second row. So there's an opportunity for me to transform the data. So I'll go and transform it so that it looks clean. Okay. So first is I need to remove the first row which is the null row. Remove the top rows. Okay. And then I need to use the first row now as a header. So you just click this option use first row as headers. That's it. So now if you see my row ID, order ID, order date, ship date, all my data is now ready. So I can say close and apply. Click apply changes. Now this is an example of web data import. You can go and preview your data right now. Uh the biggest advantage of this data connection is that it's a live data. So for example, I insert another row. Let me change the order ID. Some some I've changed some basic stuff and I it's autos saved. Control S. Now I'll go to my Tableau and I'll refresh. Now you can see as I refreshed my power query editor, I clicked refresh all, and I got my new row which is there in the live data. I got that fetched from my Okay, I got that row the row row ID number 12. So I I have to say close and apply. Now you can see the new row, the row number 12 is now available in my new data set in the data set because it's a live connection. It's a live connection with the webbased Google sheet. Okay. So this is one important way in which you can import data. Now let's try to import data from a text file. Now I have already prepared a text file called subcategories.txt. Now let me just open it in a notepad. Now it's a very plain simple file, tab separated file in which you have product subcategory ID, subcategory name, and product category key. So basically to which product category this particular subproduct belongs to. Right? So, what I'm going to do is I'm going to go back to my get data option, and I'm going to select text/CSV option, and I'm going to select option mod product subcategories.txt. Okay. So now PowerBI has identified that it's a tab delimited file. It has recognized the headers etc. Right? And I can now directly load this file. Okay. So now once the data is imported in PowerBI, it is like irrelevant to me. It's a composite data in import right. So in my presentation when I'm talking about importing data there are different importing modes, right? Import data import can happen through different ways. Okay. one is direct query mode in which I create a live uh connection to the database which I'll also show you uh using MySQL and MS SQL server, and also you can do a composite mode in which you can have data imported from Excel plus you can have direct query modes so you can have multiple uh modes to connect and create a composite data model, and that's what we are doing right now in our practical. So what we are doing over here is one we have imported data from the web, second we have imported data from a text table. Now after doing text, now our next task is to import from CSV. Let's try another one. So now I have imported product subcategory, now I'll import a CSV file. So again I'll choose the option text/CSV, and now in this CSV file, let me open this CSV file file and show you what in is it. So this is a list of all my products, product key, product subcategory key, product uh stock keeping unit etc. A simple CSV file, and I'm going to import that. Okay. So now it has identified the delimiter is comma rather than a tab, and it has already recognized the headers correctly. So I'll load it. Okay. So now my products are there. Product subcategories are there for product categories. Now what I have done is I have created an Excel mode now. So now Excel I'm using to import my product category. So now I have to click on the option of import data from Excel and I'll say product categories. Select the sheet. Load, and now so my products, product categories, product subcategories do with different uh uh data storage types, but still now the data is imported into PowerBI. It is a composite data model. Now another very important data type which you can import is the PDF also. Right? So what I have done is I have created a PDF called customers. My customers data is lying in a PDF. So what I've done is I've created a PDF which has data for some columns are there like you know customer key, prefix, first name, last name, birth date, marital status, gender, email address, annual income, total children etc etc. So this is the data set which I have created in PDF. So what I'm going to do is I'm going to select PDF now and import customers PDF. And see it has recognized my table on page one which I'm going to load. Okay. You can rename this as PDF table. So this basically these are the different type of data types we have imported, PDF, Excel, text, CSV, and web page. Now let's take a look at another interesting data set which we want to import is the MySQL server data set. So what I have done is I've already installed MySQL server on my local instance, and there's already a schema of SQL live tutorial over there.
And I have certain tables already prepared over there, like department, employee, etc. So my goal is now to import this data or create a live connection with this data set.
Now, in order to import my SQL database connection in PowerBI, you need to first download a connector—the MySQL PowerBI connector. So you need to go to this link and then click on download and install the MySQL connector based on the operating system you have. And click on download and install it.
After you have done this, go back to PowerBI and then give the IP address of the database. In my case, it's there in this local machine, and the schema which I want to import is SQL live tutorial. So, I'll give the name. Click connect. Okay, now it's connected. So now it is asking me which particular tables you want to create a connection with. I'm choosing department and employee, and I'm just loading them. Okay. So now this is the exact data which is there in the employee and department in MySQL. Okay. So this is one example of how to create connectivity between PowerBI and MySQL.
Now I want to do the same thing using SQL server, Microsoft SQL server. So I have also installed Microsoft SQL server on my machine, and I have used the SQL Express. So this is the name of my server. So which I'll copy the server name and go to get data. Select SQL server, and for now, database is optional. I can say direct query. Click okay. Okay. Now it is showing me what all tables I can import. So in my SQL server tutorial, in my SQL server, I have I have these three tables: customers, employee attrition, Olympic events. So I can use probably the customers one, which is Now you can see this is the data, the customer's data which is lying in my SQL server. Okay. So I can preview it and load it. So now you can you can preview the data in uh PowerBI that this this is the data. So I can rename is customers from MSSQL, and this is from MySQL, and okay.
So now this is not the only uh data sets you can import. Now if you take a look at the options which PowerBI gave of what different type and variations of data it can it has compatibility to import from. Okay. So we can just take a look at the categorization on the left-hand side first. There are file-based like Excel, text, XML, JSON is also possible. You can evenly directly import an entire folder, and within the folder, whatever uh data types of files are there, it'll detect it. PDF, park key, or even SharePoint folder, which is itself a Microsoft uh technology. Then different kind of databases—SQL server and MySQL we just saw, but it's not only limited to this. You can connect to Microsoft Access, SSAS, Oracle database, IBM DB2, Postgress, uh, Caiase, Terodata, and then SAP uh, uh, databases, Amazon, Red Shift, Impala, Vertica, Snowflake, and any number of databases which are there in the market today uh, Amazon etc. Then it also allows you to connect with its own power platforms. PowerBI platforms, data mods, PowerBI data flows, data vers etc. Azure, there are different kind of storage uh mechanisms in Azure, and Azure itself is a Microsoft technology. So it has a compatibility with a lot of Azure uh based data stoages like Azure SQL database, blob storage, uh Azure data bricks, right? Azour HD inside Spark. So if you have those kind of services running on your Azour cloud services, you can even import them over here.
Now online services like you know you have ERPs running uh or some data which is shared on the internet, if you want to import it uh that is also possible through certain products uh Dynamics 365, Microsoft Exchange online, Salesforce, Google Analytics, Adobe Analytics, GitHub uh LinkedIn sales if you want to do some analysis of some social networking uh you know feeds, that also you can import. Then other miscellaneous are also there. Web-based, hive, R script, Python script, if there's something to import, get data from uh Google sheets like we saw one example in our video right now. So there are multiple options available.
Now once you have imported the data which is relevant to you, um in our subsequent sessions we will see how to create relationships, but just giving you a glimpse that whatever data you are importing, PowerBI auto detects certain relationships and it'll create for you, but then you can go and manually also change. So this is the composite data model which is getting created in the back end while you are importing the data. You can easily go and manage these relationships—either keep them as is, you can delete and create new ones manually. So there is no limitation in that.
So this is what we have witnessed. We have imported data from different files types, data types, and then you know we have tried to once it is imported into uh PowerBI then there is no limitation of how you use it. You can create visualizations across different data sets and then create your standard reports. So this is the example of importing data from web, importing data from a database, from a PDF, and then once you have data, you can shape and combine data. You can basically do whatever transformation you want to do. You want to uh make joins, merge the data. So for example, if we go back to our PowerBI and if I go back to my transform data section. Now as I have now different data sets available with me, I have I can do any kind of u you know operation transformation on the data, right? Uh so like I showed you I uh upgraded the header row because one of the imported data was not showing the header correctly. uh or this columns like this exact one column is extra. I can remove the column, right? All those transformations, whatever I do in the back end gets captured in the applied steps section, right? This is the customer data. You can create uh you can merge it, you can append it uh you know with other data set, right? Let's for example, I want to create a merge data set of my categories and subcategories. So I can say merge, select these two data sets and say merge queries as new, and I can select product categories and product subcategories. Select product category key on both the sides and then take do a left auto jog jog jog jog jog jog jog jog jog jog join. So whatever product categories are there, I'll get the subcategories associated with it, and I'll create a new table which will have now I have the table which has the category and the subcategory and subcategory in one table itself. So I can rename it now to as category subcategory table. It's a it's a merge, basically it's a join between category and subcategory. Now I have a common table right and I can close and apply. So imagine I have created a new table which is imported created from one data set is which is excel based and another data set which is text based. See this category subcategory table. So now I can use it the way I want in my visualization reports. So that's what the presentation says, right? That once you have uh the imported data, you can shape, you can combine, you can adjust, you can do whatever transformation you want to do and create your visualization.
Data modeling in PowerBI. Now today we will discuss how to create relationships and different kind of data models within PowerBI based on the structure of data you're importing. Okay. So what topics we are going to cover today? We are going to talk about different types of data modeling. And the most important part and aspect of data modeling is the cardinality—the cardinality which you basically decide after reviewing the nature of data and after you've imported it, what kind of cardinality you have to basically highlight, right? And there are different types of cardinalities which you might have heard earlier also if you are from PL/SQL background, like one is to one, one is to many, etc. We will we will talk about that now. What are the different types of data modeling? Now, dimensional data modeling is one of the most popular and most uh you know widely used uh modeling. In dimensional data modeling, you have master data uh like for example customer data, date, store data, product data. So these are like you know uh less frequently changing data sets. So there is an organization, right? And you have a set of customers, their email id, phone numbers etc. that will change less frequently as compared to the sales transactions because transactions are happening every day, every minute. So sales is a more fast-changing data set. In dimensional modeling, which is in the terminology of data uh is also called as a fact, and customer, store, product which are like more of static data and not less changeable data is sometimes called a dimension. So this is a typical dimensional data model which is typically used uh sometimes, right? And then there is another model which is relational model. This is a typical model which we have been using in database design like you know primary key, foreign key relationships. So for example, you have a customer who has purchased a product. So probably he might have the customer might have the details of the product which he has purchased, and you will make a join between customer and product table and even uh you can make a join between product or product type or customer or product type. Customer table will also have a key to the product type. So this is less uh conducive for reporting, but it is more of a transactional uh relational model, but of course, this is also feasible. But from the PowerBI perspective, when we talk about reporting and visualization, this is the most extensively used dimensional data model, and this is what we're going to see in our example now.
So what I'm going to do is I'm going to show you certain data sets. First, we will prepare and create certain of our uh data sets and then we will import in our sample PowerBI file and then slowly slowly we will create the relationships. Now one important thing which you need to understand that in PowerBI if you go to PowerBI there is an option that that PowerBI auto detects new relationships after data is loaded and imports relations from the data source on first load. So for example, if you are importing the data from a database where you have already defined the primary keys and the foreign key relationships. So uh that is the first option which PowerBI will auto detect. And secondly, if suppose you are importing two different kinds of data sets, one is Excel, one is CSV. And if PowerBI detects a common column, key columns, it will auto detect a relationship which you can go and later change, modify, manage in your relationship uh menu, manage relationship menu in PowerBI, which I'm going to show you. Okay. So if I open a PowerBI and this is where the option lies. Go to file, go to options and setting options, data load, and these are the two options which are by default checked. You can uncheck it and auto and manually prepare relationships. There's no limitation to that. But if you keep it checked then PowerBI will do its job to detect the relationships. Okay.
Now coming to the next important factor: cardinality. Now before I start playing around with my data and start showing you certain relationships, it's very important to understand these four types of cardinalities. One is many to one. Right? So basically many to one means that many orders contain data of one customer. So per order, one customer is there. So from customer to order or product or delivery address, it's a one-to-many relationship. And from the other side, from order to customer perspective, it's a many-to-one relationship. Okay. Second other uh cardinality is one is to one. One is to one relationship is only applicable when you are saying is it's an extension of the current table. So for example, in one table you have employee details, and you are extending the details of the employee in another table like employee address, employee ID. So that is like one is to one. There's no multiple records of a single employee. In the address table, only one employee ID exists. Right? Now one is to many as I said is the reverse side of many is to one. It's in customer table only one customer record exists per customer, and one customer can place many orders for multiple products and can also have multiple delivery addresses. So that way this is a typical one is to many relationship. We will be seeing this example also in our sample data set. And last is the many-to-many relationship. Now many to many is a very typical example. So which I'm going to show you practically, and in our case, we will see that like for example, you have placed an order for a particular product uh you know but there are multiple fulfillments which has happened. So suppose you made an order for 10 products, but at the back end when the company is fulfilling it, is first fulfilling the first two products then the rest three. So basically you the fulfillment is happening in batches. So one order ID might have a multiple fulfillments for the same order ID. So there will be a many-to-many relationship which I'll show you practically.
So now with this background, let's start importing our data. Now the first important thing which we need to import is the master data. So first I'll import all my master dimensions which are uh which I'm going to you know use in my example. So first is the customer's table, customers data. So this is the customer details like customer key, prefix, first name, last name, birth date, marital status, and gender. Some redundant columns are also present, but we'll remove it. So my customer data is loaded. Now today's session is all about this section of modeling. So we will keep our focus over here. Okay. Now some columns, probably some blank columns are there. I can select them and say delete from model. Yes. Okay. So now this is my customer's data with the relevant columns and the key per customer key. Now there's no relationship in this model right now, right? Because only a single table is there, and the associate data is only imported. Now let me also import my another important master table is the products. Select the product data, product key, product subcategory, product SKU, product name, model name, product description, color, size. So just see all the relevant information only specific to the product is available. So I'll import it. Okay. Now see there's no relationship between product and customers directly because until unless a customer makes an order, places an order for a particular product, there is no join, right? So now between these two tables, the most important now another table which will now make sense is the sales order table, sales. Now I I'm assuming that PowerBI has auto-detected the relationship. Now you can see that because I've already uh ticked that check box. Now let's see what PowerBI what relations PowerBI has auto-detected. Let's first check the relation between customer and sales. I'll double click this uh join. Now what it has done is it has created a join of many to one between sales and customer. So what does that mean is that one customer has can place many orders, right? And that is that it has detected by the quality of the data and the data sampling which PowerBI has done. You can also reverse this relationship. Here I can select customers and I can select sales. Now it has become one to many. So that you can also do manually. So that is what I said. Whatever PowerBI is detected, it is up to the discretion of PowerBI internal configuration and algorithm, but you can go and change it. So this is now you can make this is by default active. So we want to keep it active. One customer, many sales orders. Cross-filter direction means that only from customers to sales is the filter applicable, not reverse. I'll come to this with my another example, but first let's change the relationship, so one is to many means from one customer and many sales orders. Similarly, let's see what has happened at the product side of the relationship. Similarly, PowerBI, many sales orders for one product. You can for simplicity sake you can say products sales, product key is the join. Now just focus one more thing, please. Uh also see the the column on which the join is is the grayed-out column. Product key is also here, and product key is also there, and it is what we wanted. So one is to many relationship from product to sales table and active. Now looks fine. This is something which is looking logical, and probably now we can proceed further to create a report. Now let me explain the cross-filtering with an example. Now for example, I want to check in a report that what is the count of products which uh which a particular customer has ordered. Okay. So what I'll do is I'll select the product count of product name. Now if you see the for each customer in front of each customer name the count is coming as 293, 293; it is getting repetitive because because there is a one-way filter direction filter between customers and sales and sales and products, right? So this join is single-sided; it means that from customer to product you can't find a relationship because it's a single-side cross filter, right? What does this—if I change it to both, it means that it is equal to a join between product and sales, and every product detail now is appended to the sales table. So if I want to make you visualize this, you need to go here. I'll first open my sales table; we can also open it here. Let's make clicky is okay. Now if I click okay, you can see the single arrow is changed to a double arrow. It means it's a it's a both-side filter. So when you say a both-side filter, it means that implicitly within PowerBI you can imagine that all the product columns now will get appended because of both ways filter you have applied. And if you go to your report now, see the change of the numbers now 40, 20. So the total count of products across all my customers comes out to be 293. Now the report looks uh correct. If I change the relationship from back to single between product and sales, then you can't make a join between customers and product. Basically, you can't derive the product count from the product table. See this: if you have to live with it, then you would have to go to the sales table, get the product key, and get the value of count of product key, but that is not correct. Okay. So if you want a report in which you want the count of product name, and even if you want a count of distinct product name. So this will not come correctly. You would have to go and change the direction of the filter which is from single to both. So this is a typical example there where you want to use a two-directional filter. Now let's proceed further and import other data sets in order to give show you another example. Now I want to show you an example of one is to one. So I have another table which is called customer details. So the key in this table is again customer key, but only email address, annual income, total children, education level, etc. Other details of the customer is there. So I'm loading the customer details. Now you see it has auto-detected a one is to one relationship. But what is the meaning of one is to one? Means one customer key only has one entry in customer details. There is no multiple entry. So if you click this button, it's a one is to one, and the cross filter can be both or single, doesn't matter because one customer will have only one value. You can make this as active. Okay. And if you go to the customer report table, you can now easily associate an email address with the first name. You will get one is to one record. So now you can see that with one is to one relationship with the first name, I have associated the email id, and for each email id there is an associated first name with that. So this is an example of a one is to one relationship. So in this example what we have explained is that for each customer there is an associated customer detail, right? uh so you have the first name, email address, education level, homeowner, occupation, and total children count. So in this report what we have done is uh if you click over here, so the first name and the email address, okay, so there's a one is to one relationship, and 10, and if you drag the customer key uh report takes time to render, and even if you can, so this is the reporting output: you have the customer key, first name, associated email address, and the count of product names uh which the customer has ordered. Order. Now this is an example of one is to one. Now I want to show you an example of many to many. Now for that I'll import my fulfillment data set. Okay. Now in my fulfillment data set there is a column for order number. So basically what I'll do is I'll drag order number from here to here. Okay. So now what has
Um, uh, Power BI detected? I'll do one thing. I'll select sales over here, fulfillment over here, and order number to order number. Okay. So, it's a many-to-many relationship. So, it means that per order, I have created multiple batches to fulfill that particular order.
Now, a many-to-many relationship is definitely a candidate for both-ways cross-filter detection, uh, direction. But you can you can check that. But definitely, uh, Power BI shows a warning that this relationship has cardinality many-to-many, and this should only be used if it is expected that neither column contains unique values. Okay. So we know that fact; that's why we are accepting this relationship as many-to-many because we know there are multiple order numbers over here in the sales table which are mapped to the multiple order numbers in the fulfillment table. We'll click okay.
Now, you want to keep uh the uh direction as both ways or one direction; that is up to you, the way you want to uh map the report. So I can double-click over here, and you can even click. So now you can select from which way single filter you want: from fulfillment to sales or sales to fulfillment. I'll prefer sales to fulfillment and click okay. Okay. Now we have our all our different kinds of relationships over here, uh, which we have tried to shortlist: one-to-many, to one, one-to-one, which is uh this example, and many-to-many.
Now, if I show you further relationships which you can keep on adding, like, for example, I have uh uh the example of territories. Now, in which particular territory the sales was done. So I can map it over here. Okay. So now it's a typical one-is-to-many relationship because territory is my master table, uh, where I have a static list of continent, country, region, and it is mapped to the uh territories which are for in which my orders have been placed. So it's a typical one-is-to-many. So that way, you know, you can keep on adding data.
Then you have uh details of returns. Now, this is another transactional table which is about the orders which have been returned rather than being, you know, returned by the customers. So you have a product key, and so automatically Power BI has detected a relationship between the product key and the product uh table. Right? And even if you can join the territory key in which territory the return has happened. Right? So mostly the most common relationship which you will observe is the one-is-to-many because, as I told earlier, the most common relational model is the dimensional model. Uh, the static data, the slow-changing dimensions. The SCD's are the master tables, and the most frequent changing are the fact tables. So if I talk about a typical dimensional model, the fulfillment table, sales table, and the territories table, sorry, uh, the fulfillment table, sales table, and my returns table are the fact tables of my data model.
So what exactly you mean by data transformation in Power BI? So data transformation can be a little similar to data cleaning. So before any kind of data analytics, you might be receiving a raw data from a website source, a SQL database, or an Excel file or multiple sources. Right. Once after you receive the data, whether it is batch mode data or streaming data, you are supposed to clean it, right. You might have to clean up the discrepancies like the blank rows or the blank cells or any irregularities in data such as wrong data type, right? Such discrepancies from the data should be eliminated in the first stage of data analytics. So that's exactly where data cleaning and the data transformation comes into the picture. So you have various tools for data cleaning and data transformation like Excel, SQL. But if you are a Power BI user, then good news for you: Power Query and Power BI can assist you in terms of data transformations. So in this tutorial, we will be discussing the fundamental, the most important day-to-day data transformations which a data analyst takes care of in the process of data analysis is what we're going to discuss today. So let's quickly switch to Power BI. But before that, let's have an overview of what kind of data we are exactly dealing with today. So we are dealing with Superstore data, and that's in Excel format.
So this is our Superstore data set, and we have four tabs here. The first one is the Orders tab, where we have customer ID, order ID, date, ship date, ship mode, and customer name. And in the second tab, we have the Stores data set, which has the details about the customer: from where he or she is, the state, city, postal code, and which category or subcategory did they purchase, and order sales, discount, profit, everything, right? And here we have some information about any of the orders which were returned and some people over here. So these are the four tabs that we are dealing with today.
Now that we have an overview on the data that we're dealing with, let's quickly now switch to Power BI. So now we are on the Power BI window; can just discuss changes. There you go. Let's quickly import the data from downloads. This is the data set that we want to deal with today. Now, it might take a little while to connect to that particular data set and load the data onto Power BI. Just a couple of minutes since the data set is a little too heavy. It's about 10,000 rows. So, let's wait. Shouldn't take long. There you go. The data got successfully loaded. So you have the option of loading what kind of data you want. You have four tabs as we just discussed. You can load the Orders tab, and you can load the Stores tab. And in case if you want the Returns tab, you can also load that. And if you want all of those, just load all of those. Right now, I just want the two tabs: Orders and Stores. Now here I can just directly load to get started working on this, but in case I don't want any kind of discrepancies, in case if I have a doubt that this data might not be cleaned, I shall go with data transformation. So ideally, you should go with data transformation. Check your data first before any kind of analytical processes. So let's go with that: transform data, and shortly we should be having the Power Query window open on our desktop screens.
So there you go. You can see the complete data set has been successfully uploaded: both the Stores and Orders data sets. Now, uh, let's quickly check the data from our data set. So here you can see we have Orders date, right? But I can see 42,682 and 425. This is not in the form of date, correct? So this is the simple uh uh step that we discussed: changing the wrong data type. So you can just click on the lower arrow button over here and uh or we can right-click, and here you have an option to change the type, correct. So it is considering it as a whole number, which is wrong. So you can change it to date, replace current. So now we are trying to change the Order date from a data type of whole number to date data type. So there is some error. If you click on error or if you just navigate to it, Power BI should be able to show you what error was it. And just in case if it's not working, okay, we are unable to parse the value provided. So you can just remove that and try it in a different way. Change type to date and time zone date. I think this should be helpful. Or if it's not working here, let's quickly check what could be the error. Take time. And now let's try to refresh the data. It is taking a little while. Uh, we also have another information that we deal with. We have the first row as row headers. So we should be declaring to Power BI that we also have a row header over here. It's taking a little while to refresh. Meanwhile, let's quickly check into the Stores data. And here we have customer name. So let's try to apply the second type of data transformation, which will be like, let's say, split column. We have uh the complete name of u the customer; let's try to split it into first name and second name, to buy delimiter, and we can give multiple options over here. Leftmost delimiter, let's say a person has three uh parts of his name: first name, middle name, and second name or the last name. So but we just wanted to split into first and second name. So we would go with the first leftmost delimiter and split the data set. Press okay, and it should help us to split the data. Let's name and second name. And we can also name the columns separately as first name and second name instead of custom name. It's taking a little while than the ideal time, but it's completely all right since considering the 10,000 rows of Stores data and 10,000 rows of Order data. It is all right. Not a problem. Now let's try to take a look at the Orders data set if it has successfully changed it. No, it is still showing as an error. I don't know what was wrong here. It's maybe incomplete. Let's quickly refresh all preview and check if it can help us.
So there you go. After refreshing, the first Order date is changed to date type. So what we missed is when you change the type, you're supposed to add a step. So what exactly I mean by that? Now we are trying to change the second one as well. So just wait for a while, and it will give us a choice if we want to add a new step or not. That's when we select the option: yes, please add a new step. So what do I mean by steps? So applied steps, you can see something over here, right? So every alteration, every change or every modification that you're doing, every transformation you're including onto your data will be recorded as a macro. So that can be implemented if you are loading a similar data set for the next batch. Let's say this is 2022 data, and if you're trying to analyze the 2023 data and every column is similar, and you can just follow these applied steps, and the same implementation will be automated. You don't have to spend time in doing the same process once again. There you go. So this time it has recorded the step, and it automatically has taken a new step over here: Change type step one, Change type step two. If you don't want this step to be added, you can just select the red X mark over here; it will remove it. And similarly, when you when you go back to the Stores data set, here you have the first name and second name split successfully. And uh now uh let's say you want to have unique uh customer data, right? In that scenario, you can just even remove duplicates from this particular column. Just remove duplicates, and you'll just have unique uh data. It's possible that one customer might have uh come here to buy the same pro, you know, buy the same product from different dates, or one customer might have uh done a repeated purchase. So it's possible, but again, if in case if you just wanted to know if there is a way to eliminate duplicate entries, then you can do that. So for now, let's not delete the customer IDs here because one customer might have visited the same store multiple times and uh might have purchased a different uh product or might have uh made the same order with multiple products. Right? So there is a possibility for that. Let's not disturb the data set. So I just wanted you to know if there is a way to eliminate the duplication from the data set. Yes, it is. Now let's also check another possibility of data transformation. So let's say you wanted to add a new column and identify or include some mathematical operations. For now, let's say I have sales, quantity, discount, and profit. But I don't know what's the rate, right? So here the sale is for $261, and quantity is two. But I don't know what's the rate of one for, so I can include that. You can just select the last column or where you want a new column. Just go to the Add New Column here, and here you can just uh choose the Custom Column should be somewhere over here. Yeah, this is the Custom Column. And now if you click on the Custom Column, you can rename the Custom Column to Rate of Product, and here you can choose the mathematical operations to be applied on the columns. So Sales column, insert or double-click, divided by quantity. Okay. Now it should give you the rate of each product, individual product. It is taking some sizable time. It shouldn't take so long. So there you go. You have the Rate of Product. And now let's say you want to combine multiple data sets. For example, here I have Stores data set, but my Stores data set doesn't have any data related to Orders, and Orders does not have any data related to customers. Now I want to combine these two. Is there a way? Yes, you can do that. Now let's get back to Stores, and here go to the Home option, and here you have something called Merge Queries. So now the Stores data set has been selected in the first data set. Here just select the drop-down and select the second data type, which is Orders. So here you can see Stores with the current one which is at the first place. Now select based on which primary key you want to combine both. So I want to go with Customer ID because both of my data sets do have Customer IDs. So I'll go with Customer ID, and uh both data sets will be combined at the end, at the last column. Power BI will show me a new table, not a new column. It will give me a table combined with all the columns in one column. You just have to expand the column and select which columns from the second data set you want to include in your overall data set. So let's do that practically. So here you can see I just have tables. If I select the Expand Column option over here, you can see I have a lot of uh columns here. So just deselect everything. I do have Row ID. I do have a Customer ID. What I need is Order ID, Order date, Ship date, Shipment mode, and Customer name. I do have it. So that's all I need. So just press on okay. And I should have them included in my new data set all together. It might take a little while. So there you go. We have the new Order ID, Order date, Ship date, and Ship mode added to our data set. Now just click on Close and Apply. And your data set is all ready for data analysis. Supply changes, but it's taking a little time. So at the end, you just have to click on the Apply Changes, and your data will be ready for analysis. So that's exactly how you can perform data transformation in Power BI desktop version.
So there you go. The data set got successfully loaded all over here, and you can just drag and drop them onto the visualizations part, and you can work on your data. Yes. So now the Power BI visuals are on the screen. You can see we have File, Home, and Add data to your report, visualizations, filters, data, etc., right? For now, I think we don't have any data. We can quickly import the data onto this particular platform and start our analysis. But before we get started with that, everybody knows there are simple tricks to create all the type of visualizations, right? If you expand, if I if I could expand my screen here, you can have all these visuals. And let's say if I just double-click here and if I want any type of visual, like, it'll just show me the visual, right? Let's say I want a bar graph for the sales happening in all the regions. So I'll just double-click; I'll tap it down; give me a bar graph for sales, right? It will give you, and just in case if you wanted the pie chart for the country-wise, you can just give country-wise sales pie chart, right? But now let me tell you a few things, correct. So if you are using a pie chart and if you are dealing with, let's say, a lot of companies or I mean countries, a lot of countries like 20 countries or 25 countries, right? In that scenario, a pie chart looks a little cluttered, right? And let's say you wanted to find out the sales that are happening in the region-wise, and you asked Power BI to create a line graph for that, that would not give you the proper visual; that will not give you the proper visualization, to be honest. Right? So as a beginner, if you are learning Power BI, the most fundamental thing is not just understanding how the tools in the Power BI work, what kind of visualizations you have. The most critical thing that you will need to know after understanding the basics is what type of chart is to be used for what kind of visualization. Right? So that's exactly we are going to discuss today: what kind of data requires what kind of visualization. Let's say I'm working with a date data type. Let's say I'm working with a sales data type. Let's say there is a requirement where I need to present the data in the form of a table or a card, then what are those scenarios? And if I want to use the pie chart or bar graph, then what kind of data types that I need to deal with? What are the situations where I need to use the bar graph and where I shouldn't? A few basic fundamentals that we will be dealing with today. So we have uh a wide variety of bar graphs in the first row and a wide variety of line graphs in the second row which deal with the line graph, area graph, ribbons, etc. And in this third row, we have waterfall, funnel, scatter plot, pie chart, donut chart, tree map, and next we have map and right-filled map, and we have uh the gauge cards and everything, right? And here we also have a KPI, right? So we'll also go through a KPI uh type of chart, and if you want to learn about the KPIs exclusively, then we have the KPI tutorial in Power BI lined up in this particular series. So you can also go through that, and after that we have some slicers, and we have tables, and we have matrix, right? So a wide variety of charts available, correct. So we will try to understand the major ones. The first row: bar graph, which are the scenarios where you need to use the bar graphs. Next row, we have the line, right? Line, area. So all these come under one uh kind of uh set that are similar to one another. So which is a scenario where you can use a line graph? Which is a scenario where you can use a waterfall or a funnel chart? Which is a scenario where you can use a scatter plot? Which is a scenario where you can use a pie chart? Right? A wide variety of uh probabilities, a wide variety of permutations and combinations. So what are the exact needs? What are the exact visualizations that carry a value, that carry a meaning to the stakeholder? Which are those particular charts which explain the numbers in the right way possible? So that's the point of today's discussion. So to begin with, let's import the data first from the Excel document. So we will be using the Excel data over here. Just click okay. Now you have a wide variety of tables which are present in that particular workbook. We are dealing with the Data tab. So just click on it, select and load. If there are any mistakes or if there are any discrepancies, Power BI will let you know, and it will also; it has the caliber to also fix those particular data rows. Right? So there are one or seven errors right now. You can choose to close, but the overall tutorial is about learning the type of visualization. Right? So seven rows out of 10,000 will not make a huge difference for us right now because we are trying to just understand the basic understanding of what type of charts to use. So I'll just quickly close this. But in case if you want to fix, you can just click on this View Errors, and the Power Query will open up in the background. You can just switch to the Power Query tab and fix the data rows where they really need to be fixed. Right? So let me close it for now. And now in a short notice, you can see we have the data loaded here. Now we have two types. But if you let me let us imagine that you are on Tableau, and on Tableau you have two things: dimensions and measures, right? So measures is self-explanatory; anything that deals with numbers is called as a measure, and anything that deals with characters or names or anything such which is not a number is considered as a dimension, right? So here we have Category, City, Country, Customer ID; so these are the ones which can be considered as dimensions, and where you have a summation and logo or a mathematical symbol right in front of it can be considered as a
measure. Right?
Now let's say we wanted to create the month-on-month sales report. Correct? Which deals with the data type. So just uh, date data type, right? Just remember whenever date is included in your parameters, either you are adding it to the rows or columns, just make sure that you are using the line chart, which is over here. So let's quickly rename our page to line charts or graphs. Correct. Now we have named it. Now you can either choose to double-click and add that, and then here you have x-axis and y-axis, or yeah, you can just drag the order date, expand this order date and the hierarchies over here. So if you want to go with the month on month, you can simply add this to x-axis, and you can have your sales data somewhere over here. Drag this to y-axis. This is one way of creating it. But in case if you don't want to waste time in this particular huge uh process, you can just choose to simply double-click on the canvas and write it over here: Line chart sales month. Just click, and there you go. Right? Brilliant.
Now, if you choose to spotlight, or you can just expand this, right? And if you choose the spotlight, you can see a vertical line showing you the numbers. Correct? We start from January and all the way to December, right? And here you have the month-on-month sales. So remember, whenever the date data type is included in one of your parameters, then the best way to represent, the best way to visualize the reports will be the line graph. Right? With that, let's switch to the next one.
Now, since we were supposed to discuss the bar graphs first, but let's—it's it's okay, not a problem. So, let's discuss the bar charts. Now, let us know the data set first. So, we have sales, profit, discount, numbers, etc., right? And we have region-wise, city-wise, category-wise, country-wise. So, let's go with category. Now, let's go with category and try to build a bar graph. Just double-click anywhere and category. Okay. Bar graph. Okay. If not category, you can also choose to have subcategory. Okay. G R A P H. Just take care of your spellings. I think I missed an R over here. Bar graph subcategory. Enter sales. There you go. So, you have your chart right here. If you just expand it, you can see we have a wide variety of subcategories, and PowerBI was kind enough for us to, you know, sort the data in form of highest uh um ticket price or highest selling product in the first place and the lowest selling product in the last place. So this is how the bar graphs work. But just in case if you—you can tell me why couldn't we go with a let's say pie chart, right? Let us also check that. If I just click on this, what happens? You can see a lot of cluttered data; right, you have a lot of subcategories here, more than maybe 10, right? So in this scenario, the visuals are a little displeasing, and you don't have the accurate value over here. Just undo it, and you have the bar graph, which is a a little clearer to look at, a little more, you know, decent to understand what's happening, and you can just focus on the top five over here and you can understand what's going on. Right? Now you can just rename them as, and you can choose to go with any kind of bar graph, vertical or horizontal, or in case if you have a few more. Let's say we go with the category first, and under the category you have subcategory, then you can also go with that, and you have an overlapping type of graphs over here, stacked bar graphs, which can show you in that particular category which was the product which was highest selling. Right? Now you can also add that—where is the category? Right? You can just choose that. Okay. So I think we can open a new tab and—okay, so we have the bar graph. Next we have waterfall. So let's open a, and let's name it as waterfall. So waterfall is uh something which will create performance of that particular uh property or that particular entity. Let's say I wanted to find out the year-on-year or date-wise performance of that particular subcategory; in those scenarios, I can go with waterfall. So just simply double-click and ask PowerBI to create a waterfall model, waterfall chart. Enter space sale. There you go. So it's giving you the period-over-period sales report of subcategories, and the green line indicates that it is slowly growing in terms of sales and sub, and the the red one shows the decline in sales, which is not happening anywhere, and this is the total, the overall, you know, the overall subcategories. So it'll give you a waterfall model, and the overall total of that particular uh segment is this much.
And now we have dealt with subcategory uh waterfall model, and let's try to create a ribbon chart. So ribbon chart and the area chart, those are similar to one another, stacked area and ribbon chart. So ribbon chart will give you the performance of that particular product in the uh timely—if you want to see the performance of that particular product in measured in terms of time, let's say uh month-on-month, quarter-on-quarter, year-on-year, day-by-day—that can be done using the ribbon chart, similar to the line chart, but anyways, let's take a look. I'll name it as ribbon and uh just double-click the PowerBI canvas, ribbon chart or just ribbon subcategory, enter sale. There you go. If you write order month, you can also track the monthly performance of those products, right? You can see a steady decline. You can see a steady upline. And uh so here you can see the months, and here you can see the different colors of months; different colors represent the months. So here are the products, and based on the products, how's the monthly performance, right? Is it declining or is it increasing? Can or find it out? You can basically find out that, and uh moving ahead we will deal with scatter plot, right? So first we dealt with the bar graphs, next we dealt with the line graphs, and now we also dealt with waterfall, funnel, which is something similar. Next we have stacked chart, scatter plot chart. Right now, scatter plot is a little different. Let's say you're dealing with numbers only, numbers, nothing different. Usually what we do is we carry out a dimension and a measure, right? But in this scenario, you want to deal with only numbers. Let's say you are providing some discount on all new products, and you wanted to know the profit against the discount offered. Here you are dealing with two numbers, profit and discount. Right? So in those scenarios, what do you do? So that's when you find out by using the scatter plot. Just double-click on the canvas, write it down as build scatter plot. Just check the spelling. S c a tde e r sc scatter discount enter and profit. Now it will create a scatter plot based on discount and against the profit. Now you can give some uh dimension. You can go with subcategory. There you go. Now you have the profit obtained against the discount offered based on different subcategories. Just expand it, and you can see in which subcategory what kind of discount was offered and what kind of profits did you make. So 25% uh uh discount was being offered on accessories, and you made a profit—still you made a profit of $33,000. And here you can see almost 200 discount was offered, and still you—I think that is oneplus 1 offer or maybe end of the season sale, but still they made a profit based on some parameters, and here you can see the least discount and highest profit. Okay, the least profit and the highest discount is in terms of tables, which is 33%, the maximum out of everything, and uh they still did not manage to earn some good profits out there. So this is how you create a scatter plot. Just quickly name it as scatter.
And next we can deal with the pie chart. Now just double-click on the canvas, pie chart region table. So you have four to five regions here, and uh using a pie chart would make a good uh impact on this particular visual, as everything seems clear, and you can easily make out which particular region made the highest sale by just looking at the size of these pieces. Right? Now let's quickly name this as pi. And now let's move to the—you can just uh, you know, you can use the same data for creating a donut graph. You can use the same data used to create a tree map. And yeah, those are similar to one another. And let's let's quickly jump, and now let's create some maps. Right? Now when do you need to use map type charts? Let's say your data set has some geographical data, something like city, something like country, something like continent, right? Or longitudes, latitudes, anything which gets in touch or gets in line with the geographical data, then you can proceed and build the map data types, I mean the maps, correct? So something which is related to the map data type, you can build a map. Now let me double-click on the canvas and ask PowerBI to create a map, country sales. There you go. You have—as simple as that. You have the country-wise sales on PowerBI right here. You can also choose to have filter map, which will show you how much sale is happening. The darkest color will indicate the highest sale, and the lightest color will indicate the lowest sale.
Now moving ahead we have the cards and gauge. So cards and gauge are completely similar to each other. Just click on the PowerBI, double-click. You can write card country. Okay, let's go with region because we don't want to go or you can—we don't want to have multiple cards. We just want to have three to four cards on our dashboard. So we'll go with category save. So we'll just have a card here. Right? You can just keep it anywhere on the corner. In terms of real-time dashboard, you you can just keep it anywhere. And uh let's name it as card. Now let's proceed and create a KPI. So multirow card, you can also create a multirow card. Let's say you have uh let's go back to card and check it once. So if you create a multirow card, we have three categories, and you can also add add the subcategories of each category. So that's similar to a multi-row card. Correct? Now let's go back to the last type, or we have KPIs and uh table. So KPIs and table are completely similar to each other. Let's try to go with the KPI. Now we have discount, profit, sale, and uh quantity. Correct? So KPI is something which gives you the direct real-time number of what's happening with your real-time dashboard. Correct? Now how many number of quant—you know, how many number of products are sold, what's the overall sale that we performed, what's the overall profit that we receive, what's the overall discount that we offer—in terms of one single u dashboard, you can create a KPI for that. Now let's—let me create a KPI discount first; that's easy as that. Now KPI for the profit, enter there you. Now double-click KPI for sale. Enter. There you go. And lastly, KPI for quantity. There you go. Now that's how you create the different types of charts. So basically if you integrate all these charts into one page or one dashboard or one canvas, that's what you call as a real-time interactive dashboard in PowerBI. And again coming back to the slicers, if you were using Excel, you might have to interconnect each and every single chart using the report connection option, but in PowerBI you don't have to create that particular report connection process, you—and just click on the uh slice or slices, any of the chart, and you can click on the any of the options. Let's say you wanted to find out country-wise sales, you just click on the country provided, right? So here somewhere you had—yeah, you have Jan, Feb, and everything, right? So if you just click on Jan, every chart available on the PowerBI dashboard will connect to it uh connect to the different, you know, dependent charts and give you a real-time information without having to create or report connections to each other, right? So basically if you just add all these charts onto one particular canvas, that's when you get the real-time interactive dashboard in PowerBI, and so I hope you have understood what kind of chart you need to use based on what kind of uh data you have.
So we are on the PowerBI window right now. So here we can see we have already loaded the data. We have the filters, visualizations, etc., and we have the canvas over here. Right. So in the visuals section, if you closely observe, you have the KPI over here, right? So you can either select and drag it onto the canvas, or you can just simply double-click and create a KPI. But before that, what exactly is a KPI, right? It's the key performance indicator, right? It's a full form of KPI, so what exactly is key performance indicator? Let's say we have the sales dashboard over here, sales data over here, right? Now we have region-wise sales, we have country-wise sales, we have region-wise profits, we have region-wise uh discounts, we have quantity, right? So it's like a visual, it's like a number, clear, literal, readable number, right on top of your dashboard. Right? So if you just want to have a quick glance of how many number of sales you made, how's the profit happening, how's the sale happening, how's the discount that you're getting, right? And how many number of quantity of certain product has been sold in a segment, right? So those are the key performance numbers which will be available right on top of your dashboard. So that's exactly what you call as a KPI. Now how do you create a KPI? So one way is you can just hold the KPI and drag it onto the canvas, or—so this is one way of creating the KPI. Let's remove this. Now another simplistic way of creating a KPI is just double-click anywhere on the dashboard or the canvas, and you'll have this. So just write what kind of KPI you want to create. So I want to create KPI for sales. Just create that, and you have your KPI there. Now another one, KPI discount. Just click on that. You have the KPI for discount. Double-click once again. KPI for profits. You have the KPI for profits. Now KPI for quantity. There you go. That's how you create KPIs in PowerBI. Should you need to arrange the KPI sizes or color or background, you can also do that by just simply playing around the sections over here, right? The background or the the outline section over here. You can just play with it. You can increase the size, decrease the size, add a background. You have a setting over here. You can do anything that you want. Right?
Now, we will discuss about calculated columns. Now so far what we have done as per our last session is that we did data modeling on the different data sets which we had imported in PowerBI, like products, sales data, returns, fulfillment, customer details uh and customer master data, calendar details, etc. So in the last session we prepared a data model and established the relationships between these different data sets, like one is to one, one is to many, many to one, one is to one, etc., and we saw the examples. Now once our relational model is uh prepared, our data model is prepared. Now our next activity is to create certain additional columns which we want to derive bases the data which we have imported. So for example, I'll start with my product data set. Now in my product data set, I want to introduce a column which basically categorizes that if any product which has a color uh you know red, black, or gray, I am going to tag it as a colored product. Rest I'm going to say not a colored product. Right? So all these are like example of by type product SKUs. So for that, now in order to introduce a new column, you just need to do what? You need to select the table in the data grid, go to the table tools and say new column. Okay. So column will get appended to the rightmost part, and you will start seeing a uh formula section, typical to like you get in your Excel. Now I'm going to say that the name of my column is going to be bike type color. Okay. And I'm just creating an if condition: if product color is equal to black. Okay. Or or if it is equal to red or if it is equal to gray, then say yes, it's a colored product; I'll say no. Okay. So now you can see, bases the product color red and black, they are saying bike type color yes, blue is no, multi is no, etc., etc. So this is a classic example of an if and else condition-based conditional column. Okay. So you can create such columns. Now second column, custom column which I want to create is I'm going to call as discount. Now bases the pricing of my products, I want to associate certain discounts which I am ready to give to my customers bases the product category, like what is the pricing of the category. Again I'm going to use make use of if else, but in a nested way. So if I'm saying if my product price is less than 100, then I will give 0% of uh 0 percentage of uh discount. So 0 into product price, just to keep it consistent. Now I'm saying else if less than 100 then zero, else I'll check again that if the price is less than 500, then I'm ready ready to give 1% discount on the product price, else I'll move further. So like this I have created a formula. So what I'm saying is: if product price is less than 100, give 0%; if it is less than 500, then give 1%; less than 2,000, then 1.5%; less than 3,000, then 2%; and otherwise, else less less than 3,000 if it 2%, else 3%. Right? Now after this column is created. Now you can check, right? So this—see the product price for this particular product, it is less than 100. So that's why there's no discount. It is uh between 100 to 200. Then this has been given a 1% discount. So like this all the discount column is now calculated. Now this column is available just like a regular column in my product table. Now after this I'll go to my sales table. Now in sales table I want to identify uh uh create a column called as cost. There is no product cost column over here. So that will be derived. So let's create a column called as cost, and it is derived by order quantity into—now the cost of the product is in the product table, and I know I've already created a relationship between product and sales table. So I just need to select the product cost column. Now only keyword which I have to use in PowerBI is the related keyword. So this will pick up the relation, and now for this particular sale order, the cost has already been derived. So this order number, this is the cost for which uh the product has—is the costing of the product for this particular order. Okay. Now I'm going to create another conditional column over here called as order status. I'm saying if any order whose order quantity is greater than two, then for my organization it's an urgent order, else it is a normal order. Oh, sorry. I lost it. So, this is my order status column, and I have my order quantity, urgent or normal. So any order which has order quantity one is normal. Any order which is having order quantity as greater than two is urgent. You can see this. So there's a this whole PowerBI uh tabs and sheets allow you to also review the data what you're doing. So it's very convenient. Now I have my sales data. Now what I want to bring within the sales is my discount column. So here also I want to bring the discount which I have created. So I'll say [Music] discount; discount will be order quantity into related product discount. Right? So the discount calculated column which I had created under products, I'll bring over here. Now I am creating the order level discount. So if you see for this particular order, there's a 25 uh uh you know for 25 rupee discount, and the cost is 100,000 rupees. Okay, and what is the order price now? So I have taken the order cost, the discount. Now I have to create a column called as price, order price. So that will be again order quantity into related price, which is per product price. Enter. Okay. So now I have the cost, the discount, and the price right available with me. Now I want to calculate the total uh total revenue, total profit and loss, right? Per order, how much? So first I'll calculate per order how much revenue I'm generating. So now I have to generate a column called as revenue. Revenue is price minus discount. So 1,700 - 25, 700 - 255, 2071 - 42, and if I want to calculate the profit per
Order: then it is revenue minus cost. Okay.
So now you can see, you know, typical custom columns, calculated columns which we have created are all playing around with the number, numeric values, numeric data primarily and trying to give inferences into per order cost, discount per order price, revenue and profit. So typical calculation columns which I have prepared in front of you.
Now let's take a look at other different variations of custom columns. Uh, I'll create certain columns for text-based custom columns, calculated columns uh using text data. So I'm now moving towards my customer table in which I have customer key prefix, first name, last name, birth date, marital status and gender. Now I want to create a new column in which I want to derive the age of each customer as of today. Right? So I'll use another function, a date function called as date diff. Now date div. So I want the difference between the birth date of the customer and as of today in years. Okay. So this customer as of today is 68 years old, one is 74, 68, 57, etc. So this is one derivation of a calculated column of age.
Let's take another example. Now this is a text-based column where I want to derive the full name of the customer. Now here I'll say first lower case, in lower case I'll concatenate the prefix, then amp% space amp% first name amp% space amp% present last name and closing brackets, etc. full name. Okay, so this is an example of full name. In lower cases, now another calculated column, conditional column at the customer level. I want to identify a flag which says who is my target customer. This is the demographics shared over here. Target customer. So I'll say if the marital status is equal to m and total children hurry and total children annual income. So, okay. So, let me change the logic a bit. So marital status is m and age is less than 50. These customers are my target customers. Okay. So I would say yes else no. See this, his marital status is married, Logan Diaz and age is less than 50, else everyone. So if I try to filter, so these are the my target customers, is 69 out of 1178. So this is just a conditional column, but a logical condition, an example which I'm trying to highlight over here. Okay.
Now let's look at certain calendar date-oriented columns, calculated columns. Very typical like, now I have a simple date column. Now I'll keep adding certain columns which uh, you know, which help you, which will help you understand how you can uh, you know, do some calculations on the dates. So like for example, I want a date which is 12 days after the current date, the date in the column. So just simple 12 days after, select the date and add 12. Now if you see the date format, you can go and change the format at the top and if whatever you feel like, like this. Now see, 12 days after 1st Jan 2015 is 13th Jan 2005. You can go and change the format and other details. Let me also show you. If I go to my cost and other columns, I can go and change the format. This is like a currency. Cost is currency. So, I can go and uh select the change the currency type. And you can even show the dollar value or whatever currency type it is. So numbers you can do currency or text or dates you can select the format. So this is available at the column tools level. Now in customers like we had our column of full name. So now what all things are available? Format as text. Okay. Data type text. So very minimal options are there. With date you have options of the date format.
Now next I want a column which defines the expiry date. Okay. So 8 months prior to the expiry date, within which is uh coming up in 8 months. So I'll create a column called as 8 months expiry and then there is a e date function. I'll use that. I'll use my date in the data set, I'll say 8. So now this date column will append 8 months to my actual date. And again I can go and change the format, correct. Now another important column, like I want to know the date name. So I'll use a function called as format and I'll select my calendar date column and I'll say give me the ddd format of it. So it'll give me the day name, the day, the day name of on that particular date. Next years in between. So I want the years in between the today's date and the date of my calendar. So equal to date diff, the calendar date, comma today, comma year. 7 years, 2015 to 2022. Then last date of the month. So if I want the what is the last date of this particular calendar month, I will use a function EO month which is there available in the PowerBI. So I'll say last date of the month equal to EO month. Then just select the calendar CSV date, comma zero in months and enter. Change the format. Then similarly start of the month. So I'll use a function called start of month. So for for all January dates, end of the month is 31st Jan and start of the month will remain 1st of Jan. Change the format. Next I want to know what is the week number of that particular date. So now there is an inbuilt function called week number, week num and just pass the date and you will get the week number, first week of the year, second week of the year, etc. Now another very good example is whether the week day is a weekday or a weekend. Right? So what is it? It's a week type. Okay. So I'll check, I'll put an if condition and there is a function called weekday and I'll pass the calendar, if it is less than six it means it's a weekday, else it's a weekend, so all Saturday and Sunday day names will come as weekends and else everything else will come as weekday.
So these are very different variations of different column types, calculated columns which is a very important utility and uh and any Power BI project you will definitely be ending up creating n number of calculated columns to derive your numbers to prepare your reports, but it's important to understand what all things we can do that, yes, there are n number of functions available in PowerBI, but uh what I have tried to showcase over here is some important functions but bases your utility, bases your problem statement, you can uh look up for a relevant function in the PowerBI dictionary.
Now with this introduction to calculated column, this is the base for us to now get into our next session where we will be, we will be talking about creating DAX measures and DAX functions. We will be using PowerBI DAX functions which is much more powerful than simple uh calculated columns where you can do more uh complex calculations. Uh you can calculate totals and then use them in the reports. So for that we will look up into our next session. PowerBI, let's also learn about DAX expressions and that's basically your data analysis expressions. So it's basically a collection of functions, operators and constants which can be used in formulas or expressions to calculate or return one or more values.
Now we can basically add a new column. So we can do that or we can also create new measures. Now usually there is a shorter way of doing it. You can go into modeling and here as of now nothing is highlighted because there is no data uploaded. We see just a new table. What I can do is I can go to home and I can let's get our data, but this time I'll take the simpler data, although we can work on the same earlier data set which relates to IP addresses and all that. So that also can be done and to learn we can take up this particular data which is global superstore which we have used earlier. Now here I can select orders, I can select people and I can also select returns. Now what we can do is before loading we can just do some quick transformation on this particular data. So that opens up my power query editor. So here if you remember we have worked on this, this is returns. So what I can do is I can basically go in here, I can say use first row as headers. Now that's one transformation which I would want to do. Let's go into people and it basically has person and region. We will still do the same thing. Use first row as headers. So that gives me the name of the person and the person belongs to which particular region. You have then your orders data set and here things look fine. So we can select different countries. We can select different product categories. We can basically work on your different use cases here like we have seen earlier. Picking up a category as technology, picking up a subcategory and we can also create models based on these three data sets. So this looks perfectly fine to me. So let's go ahead and just do a close and apply and let's have our data quickly loaded.
Now as I have explained earlier, it is good to do transformation, enough data wrangling so that your data is not huge when you're loading it because then that will slow down your queries, slow down your visuals, slow down your reports and so on. Now this is the data we have and say for example I would want to work on a visual. So we know how we can do that. So I can basically click on my orders. I can look at the aggregated columns such as discount, might be postal code, might be profit and it depends if you have basically not changed the data types. Now if you see here postal code and summation really does not go well. Probably this has been as uh this has been loaded as a data type which is integer, but profit and quantity looks good. Row id, sales look good. So we can work on DAX expressions. Now here if you go into the modeling it says do you want to create a new measure? You can create a new column that will get added to your visual. And here when you are looking into the table you can click on this and this also gives you an option of creating a new measure or a new column, new quick measure and you can work on DAX.
So when I said DAX, let's quickly look at what or how DAX looks like, talk about DAX. The simplest way to understand is knowing the basic syntax. So usually you first have some kind of measure name. So for example we can say average about something, we can say okay let's say average sales, so that becomes one of my measure which I'm interested in calculating. Now how do I calculate that? So for that I use an operator so which shows here, so that's your operator which you are going to use and then you use a DAX function, so DAX has or PowerBI has lot of functions which we can use, so for example I would use a function like average which we can choose from the drop-down as we start typing in. Now this one as a function then needs a referred data table. So basically let's say I would be interested in orders. So I can select my table or my data set as you say and then you can choose a particular column. So from orders I would want to do an average on say sales and I can key in the column name here and that basically is my simplest DAX expression. So we can have a complicated way of looking at it or we can basically say okay I would want to find out average sales and I would want to might be look into a particular city or where I would say it is per city. So maybe I could say average sales and then I could say by city or by year or I would want to look into a particular year if we have the order date. So we can say greater than a particular order date. So we would want how our sales have got affected after a particular date and that depends on the situation. So I can do that and here I can say greater than order date. Now for that obviously we have to use the operator and then I would want to calculate. So I can basically say calculate. Now this is what I would want to find out. So I can say calculate and then in calculate I can say let's take the column which we are interested in. So we can pass in something like a measure here. So for example I can just say average sales. This is what I want. But I will give a separator here to filter out the data. And then I am going to use my order date, for example I can basically say let's take orders and in that I am taking order date and then basically this order date has to be greater than or lesser than something. So here you are specifying your data set, your table and the column. You are giving a filter here and that's basically your DAX expression. So your DAX has different functions. So when we talk about these functions like as I said you are going for average or you're going to calculate something. So you have what we uh usually mean or uh we use is your predefined formulas. Now that can perform calculations by using specific values called arguments. So which are in particular order and structure. So always remember that when you talk about DAX, this always refers a complete column or a table. Now there are different categories of functions which we can work on. So you have date and time such as date difference or finding out now or finding out a later time. You can use something like time intelligence which is dates between first date and last date. You can go for information functions which contains custom data. You can have logical functions, mathematical functions, statistical functions, uh text functions. You have uh basically working on parent child relationships. So there are different function categories which can be used and as I said we can go for creating a new column or a new measure and we can use this DAX for our data analysis.
Now let's see how we do that. So say for example I have my order date. Now I would want to work on this. So let's select say for example go to your data set and you have lot of data here. So you can basically go for all this data here which shows me complete information of the different columns and you can choose which columns you are interested in, which columns might be you would want to cut short. So for example I have order ID, I have row ID, might be I don't want a row ID, so I can choose if I want to delete this and you can say okay I would want to delete this. Now these are some changes which you are applying and now if you see there is no uh row ID, what we see here as a field, you start with your order ID, you have your category, you have your order date, shipment. And here you have your segment and for example we have country, region, market, category, subcategory, product name, sales and then you have your quantity, discount, profit and all of this. Now what we can do is I can basically add something here. So this is the data which we have and what we can do is we can continue working on this. So let's click on home and here you have ways to transform the data. You have a new measure, you have quick measure, you have new column and you can try out these. So for example I can go into new column and that basically says okay what is your column called? Now I can say for example as I was explaining let's go for average sales. So let's call it average sales. Now that's what I'm interested in. Now I need to use an internal function. So let's type in AV and that shows me. Okay. So there is an inbuilt function called average. We can use this one. So you can just hit on enter. And now it says okay which is the data set you're interested in. Now based on the reports, based on the data sets I've used earlier it shows me options of different tables what we have or different data sets what we have. So let's choose orders. So this is what I'm interested in. You can go for double click and that gets selected. And now it says okay you want average on sales, but which is the column which you would want to use. So we can go for category, we can go for country, we can go for customer ID. All of these are your different columns. So for example, I can go for something like country and that basically gets selected. Now I can complete this by just closing the parentheses and that's basically my DAX function. So my DAX function is ready and if you want you can add details to it. So if you would want to continue your function you can always do a shift enter that takes you to the next line. If you do not want it, you can go back. You can add a comment by saying alt shift and letter a and then you can say my first DAX function and you can give in some information depending on what kind of function you are creating and that basically allows you to create the function. So this is done. Now let's hit on enter and basically it will say the function average cannot work with values of type string and and that's right, I mean we basically chose the wrong country, I mean you cannot have an average on country, so that's not right, I should use something where I have to take a numeric value, so for example I will replace this, so I will say I want average sales and here I can choose what should I take. So for example, let's go for sales and that's what I would want. So it says order sales and then hit on enter. And it basically has populated my new column. But then it is basically taking average sales and it has taken average sales overall. Now we have not, we have just selected a column. We have not given any filter. So it just gives me average and it populates every row with this one. Now this is fine that we have added a column. It has the same average value and that basically gives me sales on average. So as I said your DAX function always references a complete column or a complete table and then basically it adds the value.
Now let's see how we can use this. If you notice the field or the column has got added here. Let's get into visualization and what I can do is I can basically choose one of the type of visualizations. So for example, if I choose this and say for example, I would be adding this average sales and that is the data I would want to look into. So what we can do is we can just say okay I'm interested in this average sales. It shows me the function and we can add it here. Now this is just giving me the average sales overall. Now that really doesn't make sense. Let's look at this one or plot a graph. So it gives me what is the average sales and it gives me some visualization. So we can create visualization like this based on our column. Now what we can also do is we can go back to our data and we can go for different functions. So as I said you can create a function that adds a column. Now let's go for something else. So I will say average sales and I would be interested in say a particular product. Now we have average sales and that is the measure which we can use. So for example, I would want to find out um wherein the year or let's look at the date field here. So for example, we have country as France. It is telling me city. It is giving me customer name. It gives me a segment. So let's choose a different field and we can filter by that. So for example I'll say average sales by or whatever name you want to give, let's say segment. Now what I will do here is instead of using this average, so I will go for something like calculate. Now I can go for calculate, I can go for concatenate. So let's go for calculate. And we know that we have a particular column. So let's go for this one which is let's open up a bracket here. So let's go here. Let's give our column name. So that could be your average sales. So let's look at what was the column name and we have average sales with an SS capital. So let's go for average. And then let's go for sales. Now this is what I want to do but on what? So let's choose this. And here I'm going to now [Music] choose orders. So and then we have to basically look at the column which has the segment value. So segment, now this is what I would want to use and then we can try giving a value to this. So you have segment as corporate. So for example let's say let's go for
So, it says calculate; give an expression which we have already given that's your average sales, or we can basically give the expression what we did earlier, and then you go for a filtering value.
So I'm saying order segment, and let's go for something like corporate. Now that's going to be my segment. Let's close this one. So here's the example. What you do is you give your measure name. So that says average sales by segment. You can do a calculate. Now here you have to pass in a measure. So, for example, I'm saying average and I'm saying take an average for sales. That is, give me an average value of sales. But what I'm interested in is when the order segment is corporate. So I'm giving a filter here, and then it gives me average sales by segment.
So that's the column value here. And it is basically filtering out based on the segment being corporate. So segment is our particular column here which is showing up somewhere. Let me see where is my segment column. So we have your product. Now I have uh, let's search for country, city, postal code, customer ID, and since we have chosen order sales, it is giving me this average value. And you can choose a different column, or you can say profit is greater than something else. So I would be only interested in those values, and you can continue adding things to your DAX expression, and this is how you can do here.
So basically what I did was we were using a measure which is average order sales. I said my segment has to be corporate, or basically you can just say segment has to exist. So you can say a boolean value like equals true. Now I'm saying orders profit has to be greater than 100. And I'm only looking for my average sales by segment where profit is greater than 100, segment is corporate. And now this has calculated the value. So you basically see here. So it tells me 286 if you look at the profit value. So it is greater than 100. What I can do is I can even add a filter here. So, for example, I can say greater than, and let's give some value here. So, for example, let's go for 100 and let's see if it has done the work. So you see all the average values where it is greater than 100. And then we have to also look at our other values. We can filter it. So segment has to be corporate. And let's apply the filter here. So I will uncheck. I'll say corporate. Now this is what I'm interested in. So it tells me the corporate is sector. Now you see the sales value which is already showing up here which we have. We have average sales by segment which is telling me that you have corporate segment and it gives you where the profit values are greater than 100.
Now we have this DAX here. We have applied. We have the filter. And what we can do is we can go to quickly visualization. And what I can do is I can choose this. I can add it here. And then that says me average sales by segment. However, we can go for different kind of visualization which can give us more meaning here and look at the data. So this is how you can simply use your DAX expressions.
Now this is a simple quick uh session where you are looking at the DAX expressions. So when you look at this symbol, it means it is a DAX expression. So you can obviously double-click on this one, and that shows you what is your DAX expression. Now as I said, I have given two filters here. So always remember once you have given a measure, you give your first filter, and then you can give any number of filters; you can just order it in a different line; that should be fine. Let's say average sales by segment, okay, so let's say average sales by segment, okay, profit greater, greater than 100. So I can give some kind of name which basically identifies my column, and that gives me the value. Now if you see here, we have applied these filters, and that's why we are only seeing the relevant data which is profit which is a particular segment, and you can create any number of DAX expressions like this using some inbuilt functions.
So anytime if you would want to see if your DAX expression is working fine, what you can do is, for example, I can say test function. Okay. Now I would want to create a function, and then I can basically choose the available functions. As I said, you have logical functions, you have statistical functions, you have mathematical functions, you have information functions. So you have all of these options here, and you can choose one of these. So, for example, we were going for average; you have and and or. For example, I can directly go for and, but that would not make sense in the beginning; you can go for absolute value of something. So, for example, let's choose absolute, and now I want to work on orders. So I go for orders, and here I can say okay, I'm looking at orders, but I would be looking at sales value; I I would want the exact value. So I can choose this one right, and here now once I am creating a function, so I can be selecting a different column. So this is basically one column. Now you can add calculation you want to do, but this basically says unexpected expression because this is a new DAX for a new column. So what I can do is I can take this out from here. I can go ahead and create a new column and then or a new measure. So I can do that, and it works perfectly fine. Now I can save this, and we can call it whatever report you would want to call. So let's say superstore with new DAX, and you can share it, you can publish it, you can continue using it in your reports. So you can create any number of functions as such and then just save it. So, for example, I have a set of DAX functions, and I can upload it on a GitHub link.
So here, for example, if I go in here and if I click on DAX, so that tells me the different kind of visualizations I have based on the standard data. So it depends on uh my file which is which should be existing here. So I can go in here, and this should actually work, but the location has changed, and I just click on open report. I can do a browse report. I can go into Power BI content, and here let's look into this one and just say open. So that will not only load the report, it has different visuals and uh different visuals with the standard data set which comes with Microsoft, and it basically has different kind of visuals, and each of those visuals again have different DAX functions. So you can use these also.
So what we have learned is working on a store data set, working on some threat hunting data sets, working on our own created tables, and these are some of the pages what you see here. So this is based on the data which comes in with AWS, and you can always look into one of these, and you can search if you see here, look at this icon, and it tells me okay, this looks like a DAX function, and let's double-click on this one, and that shows me the function what you're doing. So you're creating a function called age. It uses date difference. It works on dim customer table on the birthday date, and you would want to basically find out the date difference between now and the birthday, and you would want the year. So this is the data what you have. You can obviously choose this. You can look at the result of this, and you can see the visuals. So these are some simple DAX expressions. You can create a lot of data expressions like this. Now this is here you have date function. So I can choose which are the DAX functions which are existing here. I can just load them. So, for example, this one is one of my other data sets, and then you can play around with the data here. So this is how you create your DAX expressions, and this is just this was just a quick demo on going for some simple DAX expressions. You can create different kind of visuals, and you can then save those reports. You can publish it to Power BI service, and and you can then gather insights based on this.
So this is how you work with Power BI wherein uh you can use DAX, you can use Power BI service to gather insights, you can use desktop to work on loading your data, transforming your data in different ways, and then basically analyzing it. So these days you might be hearing a lot about Power BI. We do have a lot of BI tools in the market like Excel, Tableau, Clickview, a lot. But people are talking about Power BI the most. But why? So we will be knowing that in a while. So let's get started with uh building a dashboard first, and eventually in the process you will definitely understand it. So making a dashboard in Power BI is just like a breeze.
So before we get started with Power BI, I would like to explain you a few fundamentals that you might want to take a look at before getting started. So data cleaning is a much-needed process. So you can do data cleaning using Power Query, or you can just simply open your Excel and try to check the data types for blank cells, any inappropriate datas, eliminating them. Right? So simple basic fundamental data cleaning process. If you have some irrelevant data in your data set, just eliminate that row or try to fill that with the proper data that was supposed to be there. And if there are any blank rows or blank cells, eliminate those blank rows and blank cells so that your data is up to date and accurate. And apart from that, uh let's check out some data types. For example, the first one which happens to be the row ID here. So this is the data set that we will be dealing with today. So this particular row ID has a general data type. So it can be either a number or a float. And when you come to the ship date over here, the order date over here, right? So those are date data types. And they might follow different uh formatting. Let's say they might follow uh date number that is day number, and for month they might add the alphabetical name like Jan or Feb and the year, or a few others might format with date time, and uh you know we will be having date uh and the time which will be describing the hours and seconds, right? So there are a lot of variations where a data from date data type can be saved, so it's your fundamental, you responsibility to make sure that all the elements from a specific column are of one single data type so that the you know entire data set is integral; predictions, abnormal dashboards or charts whatever you make there will not be uh those dashboards cannot be relied on, your reports cannot be uh reliable. So that's the whole point of it. So just make sure that you go through the fundamental very basic data cleaning things like eliminating blank rows, blank cells, maintaining a uniform data type for all your columns, you know based on the data. It's not like you have to maintain character data type for your dates. So you need to make sure that what kind of data type suits what kind of data, and you need to check that and make sure that all the elements in that particular column follow one standard data type.
So I'll be going with date data type for audit date and ship date, and ship mode will be character; serial uh that is row number will be serial number, or row number will be integer, and uh everything else will be data type, and when it comes to the last four rows, sales, quantity, discount, and profit. So those will be the uh you know float data type, and uh when you check out the location here, we have country, north. So these will be segregated by your BI tool, either Tableau or Power BI, whichever you're using. So those will be segregating these particular location type data types, and it will show them as a map, right? So this is the major thing which you need to make sure before starting with your you know building the dashboard. So that you know having said that, let's begin with uh the Power BI. Let me start the Power BI BI tool. Here it is. Just click on it. It should take a while.
So here we are. We are on the you know first page of the Power BI. So you can import the data from Excel. You can import the data from SQL server. You can just copy-paste your blank tables. So you can make use of some APIs and plugins and get connected to the data sources from web or any other sources, and you can also import the data from that particular source. So today we will be dealing with the Excel data set. So we will be importing the Excel file, and before that, here you can see some options which are filters, data visualizations, and uh data. So we haven't loaded any data. So you can see the data over here, and if you are on Tableau, they will be available on the left side, and you will call them dimensions and measures. So you can apply the same uh analogy here. So you'll be available with the dimensions and measures once we import the data. And here you have a wide variety of charts and graphs that you can just you know drag and drop and create. So once you have the data over here, you can just drag and drop onto the canvas over here, and then it will automatically generate some type of data set or chart. Let's say it'll give you a tabular chart. You can just click that particular chart and come over here, hover over here, and you can uh select any one of the charts available here. Let's say you wanted the pie chart. You can do that. Uh you can do a donut chart. You can do a dream app. Right? So once you hover onto it, it will tell the name of that particular chart, and you can select that link. It's based on your choice. Right? So this is about it basically. Now you can also do some drill-throughs. That's again for a session in another time, another day. So that's a session for a different day. For now, let's try to create a dashboard in a routine way. Remember I'm telling you or I'm specifying in a routine way because we are also about to learn why Power BI is being uh so popular currently in the BI industry, right? So there are some tips and tricks that will help you in the long term, so let me close the filters, close the visualizations, close the data, and now let's click on this particular option which says import data from Excel. Right now we are in the Excel data set, so this is a file where I basically store my Excel data sets that I'll be working on. So you can also have access to this. You can just let me know, and we will drop down the drive link in the description box, and you'll have the accessibility to all these data sets. So remember I spoke about data cleaning, right? So this Excel data, it is completely cleaned. Every data column has a uniform data type, and it follows that data type throughout. And if you check out this particular original data set which is sales, European sales over here. So this is the original data set which follows different nominations for data types. For example, if I come down to the date column, there are different types of data types. Some of the cells have only dates. They follow date, month, and year. And some of these cells have date, month, and year along with the time. So another glitch here. So a few of the cells were following the uh you know 24-hour timing nomenclature, and a few others were following 12 hours. This is specifically mentioning AM and PM, right? So this causes a lot of trouble when you're creating a report. Trust me, I've been there. So what I did is I cleaned the entire data set, removed the cells, I mean the blank cells, removed the blank columns, removed the blank cells, removed the blank rows. And in any situation if there is um you know uh discrepancy followed in data types, I've also cleared that, and I saved it as Excel data, right? So we will be using this particular data now, and if you need these data sets, I can provide you with that using the drive link, and you can have access; you can also try your data cleaning by following our tutorial which is linked in the description box below for data cleaning, and you can do it and you can start with your dashboards. Now let me just extract this particular data set. Just click on open, and you will be having it on the screen just in a moment. So when you check out the original data set, we have a lot of sheets here, right? So these were some pivot tables that we created for data analytics using Excel. So you can also check out that video. Now we will be doing the same data analytics and creating an entire interactive dashboard on Power BI with the same data set. So you can see uh Power BI is trying to load all the tables and all the sheets available in that particular file. But we just need one out of those. You can also click all of those, or you can just get one out of those. So for now, I just need one out of those. So here it is, and you can check the data. You can have a quick preview of how your data is looking, right, and then just click on load. And the best part is Power BI will also perform a data cleaning operation from its end and identifies if there are any rows or any such that I may start to clean, and it will notify you if there are any errors, and it will also, I mean it is also capable to you know uh fix those errors for you. You can see I have seven errors, right? So I can just view errors and clear them, or I can just close so that in the background Power BI will take care of them for me. Now we have the data, right? So here you can see the data tab got opened, and here you can have a new dropdown. If you click on that, you have all the data elements present in the data set, or in terms of Tableau, you have dimensions and measures. So basically wherever you have a summation or any kind of mathematical operation present in front of the column name, that particular element or that particular column is considered to be the measure. So which is which is basically dealing with the numbers, and all the others which do not have any other mathematical symbol like equals, hashtag, or summation, those are the dimensions, basically the character data type or the date data type, whichever uh the data type it is, but not numbers, right? So here we have it, so what you basically do is completely similar to uh Tableau, ClickView, or any other business intelligence tool, basically just drag and drop, right? Now let's say I want to find out the u region-wise sales. What can I do here is I can just drag it onto the canvas, and again I have sales over here. I can drag sales to the canvas. I can just you know hover it onto the existing box. You can see this particular box, right? You can just drop it inside the box so that Power BI will understand that I'm trying to uh you know extract the region-wise sales, and it will perform the summation of all the sales region-wise, and it'll give you a table. Let's say you're not satisfied with this particular table representation. You can just hold your table, and here you can open the visualizations and open the filters, right? And here you have visualizations over here. If you want to segregate that in form of a pie chart, you can do it right now. It will give you the sum of sales based by region. Now want to calculate the u let's say audit date you know uh date-wise sales, then I can also do that. You can just drag the sales over here and select that particular table. And uh you know whenever you are dealing with date data type, right, when you're dealing with a date data type, then what you do is you try to use the line graph; it's the best way to represent your sales, how they are happening, right? And uh few other things, let's say I want to calculate uh the profit by city or country, which country is facing the highest number of profits, you can also do that; just drag and drop, you know how it is, and okay, it's giving a lot of countries, but but still it's not a big problem for us. And just drag and drop the sales. And here you can select any one out of these. Let's go with the bar graph. And here you have it. Right now so far so good. Right. So far so good. Now if
You worry about the interactivity? You don't have to. Basically, when you're using Excel or any other Tableau, let's say, if you're using Excel, you might have to use slicers, right? So if you're not aware of what I'm talking about, you can just go check the data analytics of building the dashboard using Excel where I have completely explained the same data set and we have, you know, built an interactive dashboard there. So it'll give you a better idea about it.
So before that, um, let's get my—let's circle back. So here, uh, you don't have to create a slicer and you don't have to report the connections between each and every chart. It's automatically done in the background. For example, let's say if I wanted to calculate the sales of the central region, if I just click on the central region, it will automatically change the display of the entire dashboard and it'll give me the central region sales, right? And uh, if I just go back, it'll, you know, it'll give me the entire sales dashboard. Let's say if I want to calculate the west region, I have my best data, right? So that's the best part of PowerBI, and now we are going to identify why this—this is one good reason why PowerBI is popular.
But there is another good reason why PowerBI is so popular right now. So popular, so easy, and so effective that even a schoolgoing kid can build a dashboard. Trust me, a schoolgoing kid of grade 11, grade 12, or a candidate who is just graduating or a fresher or any person who doesn't have computer knowledge but has some good knowledge about numbers and how businesses work, they can definitely create an interactive dashboard using PowerBI even if they are new to PowerBI. So we're going to just see just that. Let's create a new page, or you can just go back to the same page. Okay, let's create a new page.
Now, let's say I don't know, uh, how to create a chart. I don't know. Let's say my manager asked me to create a complete report of the sales happening and I don't know PowerBI and I don't know anything about how to create a chart and how it should work, right? But I have a certain idea, right? Let's say I have a certain idea. I want to find out the region-wise sales. I want to find out the country-wise sales. I want to find out the performance of sales date on date, year on year, month on month, quarter on quarter, whatever it is. You just want to create, you know, you just want to extract the—you want to build an insight on the date sales and uh, you want to find out, um, you know, profits based on certain regions or certain categories, right? Which category is the highest-performing category? Which is the majorly used shipment mode, right? There are limitless possibilities. You know what to build, but you don't know how to build, right?
In such situations, PowerBI is here for the rescue. Just right-click on the canvas. Just click anywhere. Right now, you—okay, it was not the right click. It was the double click. So, just double-click anywhere on the PowerBI canvas. And there you can see something called "ask a question about your data." Let me expand that for you. You can see "ask a question about your data." Now let's say I want to create the same region-wise sales, right? You can just type "region-wise sales," and it's already giving you a, uh, you know, it's already giving you a bar graph. Now let's say you don't want the bar graph, you want a pie pie chart or a donut graph, right? Donut chart. So you can either select any one of those. I'll go with the pie chart for now. So you can just select on that. And here you have your pie chart, right? How simple is that? How easy is that, right? And now you can just place it anywhere on your dashboard. Check the size alignment, and you're good to go. Let's close these filters for now so that the canvas is a little more better visible.
Now let's say I want to find out ship mode profits and uh, the type of graph I'll go with the bar graph. There you go. Sales that happened using a certain ship mode. And you have the data right here. And I'm choosing the bar graph. Now let's say I want to calculate the month-on-month sales, right? So double-click anywhere on the canvas, sales audit date, and remember we want to represent the—okay, it's too intelligent. It already gave you a line graph, right? Just click that, select that, and uh, just place it anywhere on your chart and you can expand it. There you go. There you have it, right. And now let's do—let's try to find out a few more things. Let's try to find out uh, which of these segments gave me a lot of uh, profits, category-wise profits, category profit, and let's try to build—we have a pie chart, so let's build a donut chart. There you go. Place it anywhere on the canvas, like wherever you need it. Now, a few more things, state-wise. Okay. Now let's make it a little more interesting. State pale map. You wanted a map, right? So just select on that, and you will be having the map. Okay. Some problem here. So I think let's go with country sales map. Okay. Let's enter. Now let's select this particular chart. Okay. No interactivity right now. Select this. And here let's select map, and map and filter map visuals are disabled. To enable them, go to file, options, settings, options, global security details. Okay, let's try this. File, options and settings, options, global global security, use map and field map visuals. I think this should fix this. Okay, let's refresh. This should help us. There you go. You have your map. Let's place it anywhere in the graph in the dashboard.
Now we have the region-wise sales or country-wise sales and the shipment mode subcategory, and uh, let me know what else we can build. Let's have the KPIs here. Now let's go to the sales. Just drag and drop the sales sign anywhere on the table. I want the data presented in visuals. I have the card. Now let's have profits, and that should be a card again. And let's have, u, quantity. That should be a card again. That's our KPI. Profit, sales, quantity, discount is another one which you can add. And just add a number card again. There you go. You can go to the insert option. Insert text box. And there you can just write down "Sales Dashboard," align with text to center, and that should be good. There you go. So far so good. And in case if you wanted to add a few more visual aesthetics to your dashboard, you can also do that. You can just click done. Yeah, I think you remember your PowerPoint, right? Just go to view, and you can select any of the backgrounds you want. And there you go. You have it. If you're not happy with this, you can also have some images in the background. You can add some images which will make it look a little more interactive, right? So that's how you build an amazing interactive dashboard in PowerBI. And uh, that's the reason why—the simplicity—why PowerBI is being so popular amongst all other remaining BI tools.
And now let's get started with the customer analytics dashboard using PowerBI. So we will be using the Amazon sales data sets from 2023 and 2024 for this particular dashboard using PowerBI. So let's quickly switch between the PowerPoint presentation and the data set that we are going to use today. So this particular data set is available on Kaggle, and it is actually the data set between 2020 and 2021. So we carried out a little bit of data cleaning process and we enhanced the data set like removing the blank spaces, removing the blank cells and the blank rows basically. So and after that, changing the data type of dates. So you might be wondering there might be a few discrepancies in the way the data is formatted because there are many ways. For example, if I just select this column and go back to data type and if I go to the available dates, there are many formats. So you can see year, month, and date, date, month, and year. And there is an alphabetical representation of the month, right? So there are many variations where you can represent the date. So we are going to use one single format for the entire data set so that it can be easier for us to identify the week on week, month on month, quarter on quarter, and yearly uh analysis. So that's the whole point of it. First point: just try to eliminate any kind of blank cells, rows, or columns in your data set so that the accuracy of the data that you are using to perform analysis is intact and good, right? So apart from that, just check if you want to eliminate any of the decimal points, just select this and uh, here you can see the option to eliminate decimal numbers, right? You can use this option over here, so there are about 286,393 rows in this particular data set, so it might take a little while to uh, reflect my actions on this particular data set, and apart from that, if you could uh, just hover over through this particular data set, you have a lot of things to deal with: you have regions, you have usernames, discount percentage, and uh, you have the first name, last name of the user, quantity, order, price, value. So why are we basically going through this particular data set? It is—when you understand it, it is when you can quantify what's happening with your data set. That's when you can plan out what kind of analysis you want to perform, right? Let's say you did not get any kind of prerequisites from your manager; they just had the TS head, and you need to perform the exact, uh, you know, analysis which could benefit your organization. So they also want some insight so that they can make out some decisions out of it, right, some business decisions. So in that situation, you just have to go through the data set once and do the data cleaning process and then understand what exactly has been mentioned in this particular data set and what kind of uh, insights you can extract out of this data set, and you can proceed with that. So basically, we have quantity ordered, price, value, and uh, total. Apart from that, you have category, you have uh, different payment methods, you have uh, the year, you have the dates, and uh, you—so when you have dates, you can also create some trend lines out of it, and apart from that, u, let's say you have zip codes, region, right? So you can find out region-by-sales and a few more things what you can basically do out of it, right? So uh, having the data set understood, let's go back to PowerBI, so this is our PowerBI platform, so basically, you just select this particular Excel workbook option and import the data. I've done it basically. Here you have it. So we have the age, category, city, country, everything presented over here. Now let's quickly create the visualizations using this particular data set. So I would firstly go with a bar graph. Okay, let me choose this uh, bar graph right over here. And uh, let me create gender-wise sales. Let's—let's have this gender here. So we should be having something called as a price or a sale. So we have price over here. You can quickly draw and drag this and drop it on the x-axis. Okay, y-axis, and uh, gender on the x-axis. So we don't want this filter over here. You can eliminate this. So now you have, u, gender-wise sales, right? Now next, let's use a pie chart. Now you can find out the region-wise sales. Quickly add the region into the legends. Here you have the region-wise sales. So uh, you have Midwest, Northeast, South, and Southwest regions. So these are the sales number—line graph which can help us to do. Okay. So just click on the canvas and then double-click for your graph the sheet. Now let's use the auto date and drop it onto the x-axis and um, rise onto the y-axis. Now if you could uh, use the drop-down and use the date hierarchies, you can use the year on year, month on month. So let's go with month on month or quarter. Okay, let's go with quarter on quarter. Now you can see how are the sales running quarter on quarter in the—for this particular data set. So we have two years, that is 2020 and I mean, yeah, 2023 and 2024, the quarter-on-quarter comparison for year-on-year sales figures, right? Now let's click on the canvas once again, and now you can choose the over here and uh, so since we have two genders and I think we also have a column for age, it should be somewhere in the—So basically, you can derive what age groups have made the maximum number of sales, right. Yeah. So here we have it and the sales. So basically, it'll create a bucket, right—age group from 18, age group from 19, 20, 21, and so on. Now just go through the orders, or you can go with the price. So just drag and drop it in values, and you have it here, and you created a donut chart out of it. And uh, let's try to create a field map now. Uh, you can understand which uh, area or which region was the highest uh, sales uh, we received. So just go through the data set over here. So we have the country, just drag and drop the country and then have the price or orders; you can use anything. Okay, let's go with the orders, quantity order, and add it in the values. So here we have it. So if you could expand, you can find out which region was the one which—the highest number of orders. And there is another simple way to do it as well. If you just double-click on the [Music] canvas, it'll give you a prompt where you can write "map country-wise map." Okay. "Map state." So we have a state uh, column here, sales or price, and uh, it will automatically understand your query and create a map which will show you the highest number of sales from the regions or the region of state-wise sales. Brilliant.
Now if we proceed into the funnel chart. Okay, we have a waterfall chart. So now you can create a waterfall chart. So you just name it "waterfall." So we have, u, category somewhere. Yeah, waterfall category-wise. Just enter price or sale. And we have a waterfall chart over here based on the categories. You can just drag or you can expand the canvas to have a clearer picture. And uh, yeah, so far we have dealt with—okay, we have a scatter plot; we can do a scatter plot, scatter plot for quantity of orders received against discount offered. So we should be having quantity order 235 against discounts, or I think we can go with order IDs. So it'll give us a unique uh, representation. There has been a small discrepancy, order ID, or you can also go with customer ID against discount offered. So we have a huge data set, two lakh plus. So it might take a little while to respond to the requests. That's completely all right. Now what's left out is the KPI. So you can also create some KPIs. So just double-tap and uh, write a KPI for total sales. Write a KPI for total orders—29,000 orders—API for total discount. KPI for discount percentage. Or we can use KPI for gender, which can tell us how many numbers of females or how many numbers of males did create an order. We will be having a number here. All righty. If you could just close these visualizations over here. We can expand the canvas, and you can also have—okay, we can also minimize this particular area, and we can also have another chart or bar bar graph for types of payments, payment types, payment method, right? So we will be generating a bar graph with the highest number of payment methods used, that is cash and delivery, online payment, EMIs, etc. So it will take a little time to reflect on this particular screen. That's all right. Now if you can just go to view, and here you will be having various options for representing your data set. Just click on the best way to represent your data set. There you go. So basically, that's how you create—Okay, let's try to rearrange our charts a little bit so that the KPIs and KAS are clearly visible. There you go. So that's how you create a customer analytics dashboard using PowerBI. PowerBI makes data visually appealing. It has easy drag-and-drop functionality with features that allow you to copy all formatting across similar visualizations. PowerBI fetches data from factory sensors and social media sources to get access to real-time analytics.
Let's see what Tableau really is. Tableau is a powerful business intelligence tool which manages the data flow and turns data into actionable information. It can create a wide range of different visualizations to interactively present the data and showcase insights. Tableau has a feature of drag and drop which allows its users to create interactive visuals quickly. It can also build interactive dashboards with just a few clicks. So, PowerBI was originally designed by Ron George in the summer of 2010, and the initial release was available for public download on July 11th, 2011. The key components of PowerBI are PowerBI Desktop, PowerBI service, PowerBI mobile apps, PowerBI gateway, and PowerBI report server. Tableau software was founded in 2003 in Mountain View, California, and the Tableau Desktop 1.0 was released in 2004. On August 1st, 2019, Salesforce acquired Tableau. Tableau products include Tableau Desktop, Tableau Server, Tableau Online, Tableau Visible, Tableau Public, and Tableau Reader.
Now, let's see how expensive these tools are. PowerBI is way less expensive than Tableau software. PowerBI's professional version costs less than $10 per month per user. The yearly subscription comes around $100. PowerBI Premium is licensed with dedicated cloud compute and storage resources and is priced at $4,995 per month. On the other hand, Tableau is more expensive, where the pro version of Tableau comes at more than $35 per month per user. The yearly subscription costs around $1,000. Tableau Creator costs around $70 per month while Tableau Viewer is priced at $12 per month. If you are a startup or a small business, you can offer PowerBI and then upgrade to Tableau if the need arises.
Now coming to performance, PowerBI is easy to use. It is faster and performs better when the volume of data is limited. PowerBI tends to drag slow when handling bulk data. But Tableau can handle large volumes of data easily. It is faster and provides extensive features for visualizing the data. Tableau doesn't limit the number of data points in a visualization or enforce row or size limitations. So you can have a complete view of your data. Tableau's wide range of built-in analytic capabilities allows you to spend less time worrying about manually creating calculations, designing visualizations, and formatting dashboards.
Now let's discuss the user interface of these tools. The user interface of PowerBI is highly intuitive and it can easily be integrated with other Microsoft products. PowerBI's interface is easy to learn and understand. It is user-friendly and allows you to operate better. PowerBI Desktop provides three views which you can select on the left side of the canvas. The first view is of the report view where you can create reports and visuals. The next is the data view. In this view, you can see the tables, measures, and other data used in the data model associated with your report and transform the data for best use in the reports model. And third is the model view. In this view, you can see and manage the relationships among data in your data model. Tableau has an intelligent interface that enables you to create and customize the dashboards according to your requirements easily. It has an inviting workspace area that encourages you to experiment with data and get smart results. The workspace area has different cards and cells, toolbar, sidebar, data source page, status bar, and sheet tabs.
With that, let us now talk about the different data sources that PowerBI and Tableau can connect with. Another important feature of PowerBI is that it supports various data sources but has limited access to other databases and servers compared to Tableau. Some of the examples are Microsoft Excel, text or CSV files, folders, Microsoft SQL Server, Access DB, Oracle database, IBM DB2, MySQL database, PostgresSQL database, etc. Tableau software has access to numerous data sources and servers such as Excel, text file, PDF, JSON, statistical file, Amazon Redshift, Cloudera, Hadoop, Google Analytics, Dropbox, Google Sheets, Google Drive, and lots more.
Now, let's talk about the ease of use. PowerBI enjoys a slight edge in terms of ease of use because it is based on a user interface that has its roots in Microsoft Office 365, which most end-users are already familiar with. Tableau provides some essential advantages for exploring and visualizing data in detail. Tableau is also incorporating natural language capabilities into its software. This will help us in finding solutions to complex problems by understanding the data better.
Next, let us understand how PowerBI and Tableau differ in terms of programming support. PowerBI supports Data Analysis Expressions or DAX and M language for data manipulation and data modeling. It can connect with the R programming language using Microsoft Revolution Analytics, but it is available only for enterprise-level users. Compared
To Power BI, Tableau integrates much better with our language. Tableau software development kit can be implemented using any of the four programming languages, such as C, C++, Java, and Python. By connecting to these programming languages, you can build even more powerful visualizations.
Now, coming to the most important category, which is data visualization. Power BI provides an easy-to-use drag-and-drop functionality. It provides features that make data visually appealing. Power BI offers a wide range of detailed and interactive visualizations to create reports and dashboards. Using Power BI service, you can ask questions about your data, and it will give you meaningful insights. Tableau also allows its users to customize dashboards specifically for a device. It delivers interactive visuals that support insights on the fly. It can translate queries to visualizations and makes you ask questions, spot trends, and identify opportunities. No coding knowledge is required to work on Tableau, as Tableau provides inbuilt table calculations to build reports and dashboards.
Now, talking about machine learning and how they are different from each other. Power BI enjoys the advantages of Microsoft business analytics that includes platforms such as Azure machine learning, SQL server-based analysis services, data streaming in real time, and many Azure database offers. It helps to understand the data and analyze the trends and patterns in the data. You can also forecast the data to make future predictions. Tableau supports the features of Python machine learning. This enables it to perform machine learning operations over the data set.
Finally, let's talk about customer support. Microsoft Power BI is relatively younger in the market than Tableau and hence it has a smaller community. While Tableau has over 160,000 active users participating in over 500 global user groups and over 150,000 active customers participating in the Tableau online community.
That's a wrap on our Power BI full course in 2024. If you have any questions or want to share your experiences, then leave a comment below. Your feedback helps our community grow. If you found this course useful, please give it a thumbs up and consider sharing it. Don't forget to subscribe and hit the notification bell for more updates.