 Hey guys, welcome to SSUnitech, so see in this side and this is continuation of Power BI tutorial. So today we are going to see about the merge queries inside the Power BI. So in the last video we have seen how we can create the table manually inside the Power BI desktop in query editor and how we can insert the data on test table. So here this is very important concept inside the Power BI like what is the merge queries and how we can use it. So go to on Power BI desktop and we will see in the practical how we can use the merge queries in the real time. So this is the Power BI desktop and this is the country sort name tables as we have created in our last video. So here as we can see it is having two columns first is country name second is sort name. Go to on dim address table and this table is also having the country names. So what is our requirement? We just want to get the country sort name from the country sort names table in the address table. So for that we have to use the merge. So basically merge something like the joining between two or more than two tables. Here go to on home ribbon and here go to on the last merge queries and append queries. So we have discussed about the append queries. This is something appending the queries like first row and second rows one by one. So inside the merge query we can see it is having two options first is merge query second is merge query as new. So if we use merge query then it will not going to create any new query the join will be happen with the existing table like in address table currently we are selecting on next merge query as new. If we select this merge query as new option then it will create a new query and merge will be going to happen on that new query. It will not going to affect our existing query but here we just want to use the merge query directly. So click on merge query after that this is our left table and here just click on this and we can see we just want to join with the country sort name. So what would be the joining condition? So it should be country name and here country name after that we need to wait here we can see all is going to match that looks good join kind. So what is this join kind? If we click on this then we can see we are having a lot of options like left outer then right outer then full outer then inner left empty and right empty. So what is this join kind? So first of all let's understand about this join kind. So go to on excel here I have created the scenario. So let's assume this is our first table and this is our second table. In the first table it is having two columns id and name second table is also having id and salary. In the left table as we can see records is one two and four and in right table that is query two it is having one three and four. So what is the left outer right outer and full outer? If we talk about left outer then just concentrate on this. So it is going to combined left table with the right table and all the records from the left table will be a label over here just like the left outer join in our database tools. So here very similar like one two and four should be here. So one two four we can see names abc because it's coming from left table so abc and the matching rows from the right table. So one hundred is matching two hundred is here for four is 300 matching for three hundred is here but two is not going to match with the query two. So it should be na that is not applicable. If we talk about right outer join so it should be having all the records from the right table and matching records from the left table. So as we can see it should have one three and four so one three and four after that hundred two hundred and three hundred have salaries hundred two hundred and three hundred the matching records from the left table. So three is not available in the left table. So here we can see three name is a name because it's not available in the left table for one is a and four is c is available. So we are getting like that. Next is full outer join. So this is very similar it will be going to get the matching and non matching records from both the tables. So first as we can see one and two then three and four. So here one is going to match with the left and right table. So name and salary is coming after that we can see two is b two is b but here two shouldn't going to match. So we just need to delete this. I made this mistake. So it should be blank. So something like this four we can see c and four is 300. So it should be 300 and in case of three it should be 200. So something like this. So matching records from the right and left tables which is id one then non matching records like two is not going to match with the right table three is not going to match with the left table and four is going to match with the both the tables. So this is something like full outer join after that here we can see in the anti in the left table it will be going to get those records which is not going to match with the right table. This is anti left then anti right it will pick those records from the right table which is not going to match with the left table after that inner join it will be going to return only matching values from both the tables. So this is something like we have joins in the database tools now move to power bay desktop. So in power bay desktop as we have selected here we either we can use left outer or we can also use inner join because all the values should be match. So we need to wait few seconds. So here as we can see all the values are going to match like 13401 13401. So all values are matching. So we can click on okay now we need to wait few seconds. So here as we can see country short names is added here we can select the table we can directly click on this arrow after that we can select those columns which we want. So here we have two options first we can expand second we can do the aggregate. So here we just want to expand and want short name now click on okay it will take few seconds now we can see this is the short name and it's coming from country short name tables. So this is very important while we gonna use one or more than one tables. So this is very important and very simple to use as I explained. So hopefully you have understand how we can use the merge queries and all about the join like outer join, inner join and anti-left anti-right join. So thank you so much for watching this video. If you like this video please subscribe my channel to get many more videos. Don't forget to press the bell icon to get the notification of our newly uploaded videos. Thank you so much.