Skip to main content

Posts

Showing posts with the label inner join

Using NATURALINNERJOIN Function in DAX

This post is about how to perform inner join in DAX. If you don't know what that is you, can access my previous post  here  which is about join types. Microsoft's definition for NATURALINNERJOIN is: " Performs an inner join of a table with another table. The tables are joined on common columns (by name) in the two tables. If the two tables have no common column names, an error is returned." And the syntax is: NATURALINNERJOIN(<leftJoinTable>, <rightJoinTable>)   First of all the definition is wrong. I had two tables with no common column names (check the image below) and I got no error. This definition is really misleading because it makes you think that Power BI creates connection between columns by using common column names but that's not what happens. You need to have a relationship between 2 tables to perform inner join. This Microsoft definition definitely needs correction. These are my tables and below is the formula with the result table. As you...

Join Types

I have been thinking about writing a post about joins for a long time and the day has finally come. In this post, I am going to introduce the join types. In my upcoming post, we are going to learn how to join tables in DAX and in Power Query. Not to complicate things unnecessarily, I am going to keep definitions as simple as possible and use lots of visuals. Let's start then. Left Outer Join : It returns all the rows from the left table and the matched rows from the right table. It's also called left join. If you come up with any of the names, be aware that they are the same thing. Right Outer Join: Returns all the rows from the right table and the matched rows from the left table. It's also known as right join. Full Outer Join: It returns all the rows from both tables whether they are matched or not. Since it takes all rows, it can return very large result sets. Inner Join: This one is also known as Inner Join :) It takes rows that have matching values on both tables. Left...