Skip to main content

Posts

Showing posts from January, 2021

NATURALLEFTOUTERJOIN Function in DAX

This post is about how to perform left join and right join in DAX, and in Power Query. If you need to refresh your memory about join types, you can read my post about it  here .  NATURALLEFTOUTERJOIN is used to perform left join in DAX. Left join means combining two tables by taking all the rows from left table and only the matching ones from right table. Microsoft's definition for this function is exactly the same as their definition for NATURALINNERJOIN meaning somebody made a wrong copy-paste. Here comes their links: https://docs.microsoft.com/en-us/dax/naturalleftouterjoin-function-dax https://docs.microsoft.com/en-us/dax/naturalinnerjoin-function-dax The syntax is pretty simple: NATURALLEFTOUTERJOIN(<leftJoinTable>, <rightJoinTable>) Like I always do, I am going to explain it over an example. These are my tables that I'm planning the join.  This is the formula to join them and the error message comes with it. Like any other join function in DAX, it requir...

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...

Exporting Data In Power BI

Power is like the year 2020, full of surprises. You must be wondering what did it do again! Well, it really surprised me the other day. When I was exporting data from Power BI, I've faced a very unexpected result, and this post is about that result. And of course, about the solution to that. This is my data table. As you see, the table has 23,443 rows. On the report view, I have created a table visual by taking all the 23,443 rows and all the columns of this table. And there is no explicit filter on that visual like report level, page level, or visual level filter. After that, I have clicked on Export data option. That option creates a CSV file that you can save on your computer. And this is the CSV file that Power BI has created. In the beginning, everything seemed quite normal. But when I kept scrolling down, I have noticed that I have much less row than I was supposed to have. When I was creating this file I was hoping to find all the 23,443 rows on the visual. But 167 is not ev...