camillanaep
New Member
- Joined
- Nov 13, 2017
- Messages
- 1
Hello everyone!
I have a query here wich contains 10 different columns. I need to create 4 other columns (A B C D), with formulas that contains values from this 10 first columns.
One of my inicial columns is called "Period", and it starts in 1. So, when period is equal 1, colunm A is equal another colunm in the query. Based on A value, it calculates values B, C and D.
When period is not 1, value D from the period before becomes value A, and using this A value, it calculates values B, C and D.
My query:
(Column 1) (Column 2) ..... (Wheight) (Period) (A) (B) (C) (D)
Basically it works like this:
So whats happens is:
(an example)
(Column 1) (Column 2) ..... (Wheight) (Period) (A) (B) (C) (D)
100 1 100 0,02 4 104
100 2 104 0,06 3,5 107,5
....
The termination condition is when the next period is a number lower that the number before.
Does anyone know how can i do this?
I tried to create a power query formula, but i can't seem to get it right.
Thank you so much!
I have a query here wich contains 10 different columns. I need to create 4 other columns (A B C D), with formulas that contains values from this 10 first columns.
One of my inicial columns is called "Period", and it starts in 1. So, when period is equal 1, colunm A is equal another colunm in the query. Based on A value, it calculates values B, C and D.
When period is not 1, value D from the period before becomes value A, and using this A value, it calculates values B, C and D.
My query:
(Column 1) (Column 2) ..... (Wheight) (Period) (A) (B) (C) (D)
Basically it works like this:
- My column (Wheight) contains always the same value (all rows have the same value).
- The column "Period" starts in 1, and can end in 15 or 20.
- Column "A" : when period=1, "A" = "wheight", and in the following rows, "A" = "D" from the period before.
- "B", "C" and "D" are calculated based on the "A" value, with some formulas.
- And "D" is calculated as a sum of "A", "B" and "C". (So, D value is always increasing, because is the A value plus other calculated values, in B and C.)
So whats happens is:
(an example)
(Column 1) (Column 2) ..... (Wheight) (Period) (A) (B) (C) (D)
100 1 100 0,02 4 104
100 2 104 0,06 3,5 107,5
....
The termination condition is when the next period is a number lower that the number before.
Does anyone know how can i do this?
I tried to create a power query formula, but i can't seem to get it right.
Thank you so much!