Calculated column offset by 2 - powerbi

https://i.stack.imgur.com/BTjZv.jpg
I am trying to generate a calculated column B from column A. Notice that column B is basically the same rows as column A except it's offset by 2 rows. I'm trying to generate this with DAX but I don't even know where to begin. I would appreciate any help.

You can use in PowerBI the PowerQuery Editor to append a Column with 2 "null" values (as numeric type) like the example below:
append column in powerbi example
To get this result:
final result of "column B"
Think is a easy way to get what you want.

Related

PowerBI concatatenate 3 tables

I'm trying to concatenate 3 different tables in powerBI, with powerQuery but I couldn't find the solution for it. The closest I could find is appending the query, however it does not concatenate the table shown below.
Example:
Im trying to concatenate table Code1 to Code2 to Code3 (bottom 3 tables) to look like the top one.
Thank you very much for your help
Alternate method
In Table3, add column, custom column,
= Table1
then expand
Add column, custom column
= Table2
then expand
Add a custom column to each of your queries, all with the same value. For my test I just used the value of 1.
Then merge Query 1 to Query 2 on your custom column. Next, merge that query to Query 3 again on the custom column. Once you rearrange the columns you will get an output that looks like this:

Create Table with a columns is a sum from values from other tables

I'm "bugging" to transform my datas to something usable.
For the moment, a datasource provides me a table where a column contains dates, following by 24 columns representing each hours. In this 24 columns, for each date (each row) I've a total of phone calls.
I want to show the hourly repartition. So, my original datasource is not really usable ans need to transform it with something where there is a column "hour" (a simple index from 0 to 23 or 1 to 24) and a column with the total call for each column from the original column. But I'm a lot confused to do it because I don't have a way to create a relationship. Like this :
Someone have any idea to help me? Thanks in advance
I would unpivot the data source and then create two dimensions (Calendar) and (Time).

How to sum a column filtered by a categorical column in the same table in Power Bi?

I'm trying to get a sum of my sales figures by the product category from the a column in the same table
The original data is on the attached image.
Original Data
And what I'm trying to get is attached also and I am having trouble getting the right numbers for the last three columns
Result
I have tried the following code:
Boots_Sales = CALCULATE( SUM(Sheet1[Sales]), FILTER(Sheet1,Sheet1[Product_Type]="Boots"))
I have found a solution to the above by making a measure instead of a column with the below formula:
boot1 = CALCULATE(SUM(original[Sales]),FILTER(original,original[Product type ]="Boots"))
This will have to do, I was trying to make a column because I wanted to do further calculations on the column but will just have to convert the measure into a column
Thanks

Calculated Column in PowerBI With Filters

I have a problem to solve similar to the example in the image below. I have the values of Column 1, 2 and 3, and want to get the calculated values exampled in Column 4. These are the number of times that the same number of Column 3 appears for different combinations of values from Column 1 and 2.
Thanks in advance for any help!
If your table has as name 'table1',
then the following dax statement will calculate column4.
Column4 = CALCULATE(countrows(Table1);filter(Table1;Table1[Column3]= EARLIER(Table1[Column3])))
Keep in mind that based on regional settings, you have to replace the ; with , in the example provided.

A table of multiple values was supplied where a single value was expected, when using Distinct

I have the following table:
I'm trying to create a new column using Dax language:
Column = DISTINCT('Edição'[País])
But I gott this error message:
A table of multiple values was supplied where a single value was expected.
The expected result is:
You have a source table with 21 rows. You want to add a column. In the end you'll still have 21 rows.
The "expected" table has 18 rows. So with only adding a column you will never get there, it's just impossible.
To get the expected output though, you can do this easily: just create a table with just Pais as values and PowerBI will automatically group. See here a (more minimal) example:
PS. If you wanted to add a column -say- with the number of years the country appears in the source data, you should:
choose the matrix visualization
add "Pais" (country) for rows
add e.g. "Ano" (year) for values, and summarize by "Count (Distinct)"