 Hey guys, welcome to SSUniTech. So since decide and today we are going to start a new playlist on the DAX tutorial. So before going to start today's video, if you haven't watched the Power BI playlist and you don't have the basic understanding about the Power BI, so I would strongly recommend to watch those videos because here we are going to write the queries that is the data expression inside the Power BI. So what is the DAX? So DAX is a language and that language is data expression. So inside the data expression language, we will be going to write the formulas or we will be going to add a new columns inside existing tables. So in the today's video, we will be understanding about the calculated column versus measure. So before going to start with the actual working with the DAX, you should be understanding about the calculated column and measures because these are the major things where we will be going to use the DAX. So what is the calculated column and measure? So a calculated column belongs to a single table and your measure will be going to belong all your data model. So for example, we are having a report and this report is having multiple tables. So if we are creating any measure so that will be our label for all those data models and if we are creating any calculated column, so that calculated column will be available only a single table where we are going to create that so that we will see in the practical. Don't worry for now. You can only understand what is the calculated column and the measure. So calculated column will be based on a single table and the measure is based on the whole data model. Next a calculated column is evaluated on the row contest so which is the row by row. So this is very important that you have to remember like the calculated column is a row contest and the measure is evaluated on the filter contest. So you have to understand about the row contest and filter contest. So in this video, we will see little bit about the row and filter contest but this is very important. I will record a separate detailed video on the row contest and filter contest. So before going to jump and see in the practical about the differences between calculated column and measure, let's try to understand about the source that we will be going to use whole this tutorials playlist. So here as you can see we are having this excel file and I will be going to provide this excel file on the description of this video. So you can download and you can start using it. So it is having total four tables. First is the sales order. Second is the customer. Third is the reason and fourth is the product. So if you can see inside the sales, so this is the fact table and inside the fact table, if we can see about the customer, then we can see the customer ID and when we go inside the customer seat, we'll see the customer ID. So by using the customer ID, we can join between these two tables and we'll get the customer names. Similarly for the reason here, we have the reason ID and in the sales order will be also having the reason ID. So by using the reason ID, we can join it similarly for the product. So here we have the product ID and we can see inside the sales order. We have the product ID as well. So if we want to get the information from the dimension tables, then we can join based on these columns. So let me go inside the Power BI as I have already imported the data inside the Power BI desktop. So let me quickly go in the relationship so I can show you that. So as we can see, this is the fact table, which is the sales order. So inside the sales order, it is joining with the first table and which is the reason. So it is joining based on the reason ID that you could see like the reason ID is connected with the reason ID and it is having one too many relationship. Let me scroll down and we'll see the other relationships. So here we have the product. So we can check the product ID is mapping with the product ID in the product table and it is also having one too many relationship. Similarly, we can go in the customer and we can see the customer ID is connecting with the customer ID. Let me double click on that. So we'll verify the same. So in the sales order, we have the customer ID and the customer ID in this. So let me cancel this. So our data model is ready. Now we try to go inside the data tab and you see this data tab. Let's come with the first requirement for creating the calculated column. Let me quickly go into the sales and inside the sales order table. I just want to do the sum of the total revenue that we can see here. So this is the total revenue. I want to have another column over here and that column will be keeping the data for the total revenue that is the sum of this. So how we can do that? We have to add a new calculated column. So we can go inside the column tools and here we can see this option. So we can click on this. So it will be adding a new column on this. So here as we can see it is added a new column. Let me call this as revenue total. And this is for the calculated column. Let me do the sum of the total revenue. Let me close the bracket and put enter. So this is simple sum function we are using for doing the sum of this total revenue that we can verify like this is the overall value it is having. Now let me quickly go inside the visualization. As we have already created the calculated column let's try to create a measure for getting the total of revenue. So here we can see this icon. So it is saying you can add a measure. We can click on this. So it will be adding a measure and let me quickly call this as total revenue measure. And here again I am going to do the sum of total revenue. Let me put enter. It can be available any one of the table which is under this data model. So it doesn't matter on which you want to keep this. In our upcoming video we will be going to see like what is the best approach and inside the organizations how we are keeping the measures inside a table. So that we will see in our upcoming videos. Don't worry for now. Now let me try to add a very simple visualization that is the table. So we can click on this table and here let me try to drag and drop the order ID. So that is the order number in this table and next I am going to add the total revenue from the calculated column as well as the total revenue that we have created from the measure. So this is for the measure we can drag and drop. Similarly we can go inside this sales order and here we can check the total revenue which is the calculated column and we'll see the difference. So what is the difference? So the major difference that we can see we have the order number that is okay. Then here we can see the measure. So it is based on the filter contest as I told you in the slide. So this is the filter contest mean. Here we can see this sales order. So this sales order is going to filter on this particular measure value. So it is having this much revenue. So that's why it is having only this revenue. But in case of the sum when we have done the calculated column. So it is having the actual total sum of all these sales orders so that we can see this value is coming again and again for each row. So I hope guys you have understand when we can use this as a calculated column and as a measure. So whenever we are going to do as a filter contest we can go with the measure. If we are doing the sum like this then we can go with the calculated column. And one more difference why we should go with the measure and why we should not go with the calculated column. So if we can see inside the data again. So here we can go inside the sales order. So the column that we have created is physically available on your data model. So it is also consuming the space. So that's why it is already consuming the space and physically available on your data model. So that's why we should avoid using the calculated column. We are checking about the measure. So it is going to calculate at the run time. It is not physically storage any location. So that's why we should go with the measures as much as possible. So I hope guys you have understand about the calculated column and measures in our upcoming videos. We will be seeing in detail each and every concept. So stay tuned and keep watching SS unit tech and do subscribe and please like this video.