Power BI: Append similar table but null in custom column - powerbi

I have a table in Power BI which I'm working with. In this table I have some regular columns with values and I've created a custom column with a very simple formula. In this example the custom column is the result of A + B.
Column A Column B Custom Column
0 20 5 25
1 30 10 40
2 10 20 30
My problem is when in the Power Query Editor I try to append a new table with the same structure of columns of the main one but it appears null in the values of the custom column. This new table contains as well Column A and Column B but in the Custom it doesn't appear the result A + B but it appears 'Null'.
Is there any way of solve this? I mean, when I add a new table automatically it shows the values in custom columns instead of 'Null'. Thanks in advance.

If I get your issue correct, you are performing the "Add Custom Column" steps before you are appending both table. You can just change steps sequence between "Add Custom Column" and "Append Table".
First perform the "Append Table" step and then add the step "Add Custom Column". This will solve your issue.
Here is your case-
Here is after altering the steps-

Related

PowerBI - Duplicate Entries in Query

I have created a query on three tables. Here there is a column GUID (which is actually unique), then there is a column date/time and a column with a phone number.
Now if the same phone number calls more than once, get duplicates with always the same GUID. Can I filter this in Power BI so that the ID only appears once?
If I understand your requirement correct, There is an option in Power Query Editor to remove all duplicate rows. You can first select your all 3 columns- guid, date_time and phone_number. Now right click on any of the Column's header and select Remove Duplicate from the list as shown in the below sample image-
This should keep only 1 rows per distinct combination considering 3 columns.

Sort Months name Chronically in Descending order in Power BI

I have a very basic question in Power Bi I am trying to build a report in which I am using a Matrix Visual to display some data in the below format, However, I want the most recent months data to show first dynamically and then the following months after that, in this case show May first instead of Jan, Apr second instead of Feb and so on and so forth.
You can perform these below steps to achieve your required output-
Step 1:
Add a new custom column "month_name" (if not already available) in Power Query as shown in the picture. Please use the Date column from your source go generate the new column.
Step 2:
Add another custom column "year_month" as shown in the below image. Remember the target is to get the value like - "202001" (YYYYMM) from the date value. You can achieve the same with other conversion option as well. Please use the Date column from your source go generate the new column.
Step 3:
Change type of "year_month" column as Whole Number and get back to your report by clicking on the "Close & Apply" button.
Step 4:
Create a custom column "Rank" in the table as below-
Step 5:
Sort the "month_name" column using newly created column "rank" as shown in the below image-
Step 6:
Finally use the "month_name" column in your Matrix visual's column and this should be come up with your required output.
There is no option to sort matrix headers in power bi.
However there is a trick that you can apply in order to achieve this.
First Create a new column that referes your month column:
DescMonth = Table[Month]
Then create another column that keeps the order of the new column (you will need an ID Month column for this so be sure to create one if you haven't yet):
DescMonthOrder = - ( Table[IdMonth] )
Then sort the DescMonth column using the DescMonthOrder column
Finally use the DescMonth column in your matrix instead of the regular month column.
This way you will be able to achieve the following result:

Power BI: Customize X-axis labels from related table

I have a column chart which plots data from Table A. Table A has release names and counts of defects in each release. Here is how it looks
I have another Table B which has the release dates. Schema of that table is:
Release_Name Release_Date Full_Release_Name
Full_Release_Name actually does not exist. I can create it as a calculated column which concatenates Release_Name and Release_Date.
In the column chart I want the X-axis labels to appear as e.g. IR 18.4 19/12/2017.
How can I do it, without adding a redundant concatenated column in Table A? I want to avoid this as the number of rows in Table A is going to be very large.
I could resolve the issue as below.
Create a relation between the 2 tables
Add the Release_Date field from Table B as 2nd entry on Axis
Drilldown to level where it shows concatenated Release name and date.
If you spot a problem with this approach, let me know.

Dynamic column names in power bi

I have imported an excel file for creating a PBI report. In this excel, there is a cell which contains a date. I want to create columns on the basis of this cell.
Like if the cell contains 01/04/2017 then I would like to generate column names like Apr-17, May-17, ..., Dec-17, Jan-18,..., Mar-18.
If there any way to do this?
I'd say just create a step by step procedure in edit query to pivot the table.
First you'd only get distinct values, then pivot and then promote to headers.
I don't think you need a column per month.
1) Create a query to import your file
2) In Query Editor, select the query, then "Transform" -> "Use First Row As Headers"
3) "Transform" -> "Unpivot Columns"
4) Rename columns as desired
Now you have a table in a comparable/filterable/queryable form. You didn't specify what you need it for but having a column per month won't work well (for various reasons). PowerBi doesn't work quite like excel.
If you really wanted a column per month, you could stop at step 2) but I would advise against it.

How to add external data as new columns in Power Query?

Today is my first day to use PowerBI 2.0 Desktop.
Is there any way to add new columns from external data into the existing table in my PowerBI?
Or is there anyway to add new columns from another table in PowerBI?
It seems that, in PowerQuery, all the tabs Add Custom Column, Add Index Column and Duplicate Column are all using the existing columns in the same table.....
You can use Merge Queries to join together two queries, which will let you bring in the other table's columns.
Also, Add Custom Column accepts an arbitrary expression, so you can reference other tables in that expression. For example, if Table1 and Table2 had the same number of rows, I could copy over Table2's column by doing the following:
Add an Index Column. Let's call it Index.
Add a Custom Column with the following expression: Table2[ColumnName]{[Index]}