Skip to main content

Posts

Showing posts from September, 2020

How to Move Date Column to the Beginning of Table

The order of columns in Power BI might not seem important but there are some scenarios when locations of columns matter. For my latest project, I needed to append tables with DAX using "UNION" function at Power BI Desktop and I needed my date column at the beginning of the table, like the other table which I am going to append, but it was at the end like you can see below: I can almost hear you saying "That's easy. Go to the Query Editor, right-click on the column, and select Move To beginning." Honestly, I wouldn't be writing this if it had been worked. That step moved my column to the beginning of the table at Query Editor but not at Power BI desktop. After I close and apply, I saw my date column at the end of the table again. Hopefully, there is a very simple solution to this problem. First, we go back to our almighty Power Query Editor. On queries pane, we right-click on the table that has the date column, select Advanced Editor, and copy all the content...

Which Image Displayer Is The Best?

Lately, I have needed an image displayer for my Power BI report and I have decided to do a little research before I choose which one to use.  After all, Power BI offers many of them at App Source, and the more choice I have, the pickier I become. Here is the full list of image displayers that I could find, and they are all free. Table and Matrix: These are between the options that let me display visuals on Power BI's visualization pane. The advantage is they come with Power BI. You don't need to download anything from App Source and they support URL. It doesn't require encoding the image's URL to base64, meaning you need to find an encoder tool, doubling your work. They might be preferable because they don't have the risk of simply disappearing as they are Power BI's own tools. It's possible to change the size of images but it's not possible to fit the image 100% to the frame. When I tried to small the frame, they both created a scroll-down menu which d...

How to Add Flags to Power BI Reports

Adding flags to Power BI Reports might be easier said than done. If you have a dataset which contains data of various countries, adding country flags looks cool. The process to do it, on the other hand, might be compelling. Now I am going to share with you the obstacles I  have faced during the process and of course, how I overcame them. First I made an excel list of countries that my dataset has. Then I have downloaded to my computer all the flags I need from Wikipedia and converted them to Base64 link via an image encoder website  base64-image.de  and added those links to my excel file, which looks like this: After I added my excel file to Power BI, I converted the data category of URL column from 'uncategorized' to 'image URL', which might be a small step for you but it's a big step for the success of the flag operation. Then I created one to many relationship with DimLocation table and chose 'both' as filter direction, so that I can filter from both t...

Calculating Running Total with Quick Measure in DAX

It's been a while since quick measures were introduced and it might be tricky to decide whether to use them or not. What I have noticed recently is calculating running total with quick measure might not provide the best user experience because it simply doesn't filter explicitly, despite ALLSELECTED function is part of the measure.     This is the quick measure to calculate the running total and it can be seen that ALLSELECTED function is part of the equation. As a result, I got the impression that when I explicitly filter, the measure will retain all the explicit filters but that’s not what happened. This is how it looks like before I use any explicit filter.   Everything looks perfect right. What until I filter 2017 and 2018.     As you see two numbers don't match because quick measure adds up sales of 2016 despite I didn't select 2016 on year slicer and despite quick measure uses ALLSELECTED function. This is the result we were supposed to get if ALL function...