Forum Discussion
StepanResl
6 years agoFrequent Visitor
Recursive Calculation of Table
Hey, I have table like this with columns Year, Month, Person, Static (Costs) and Revenue. I am trying to find out, how to provide last column inside Power BI. In column header I wrote Excel Formula ...
v-lionel-msft
6 years agoCommunity Support
Hi StepanResl ,
1. Add an [Index] column manually.
2. Create measures.
Measure 2 =
VAR x =
MAX(Sheet5[Revenue]) - MAX(Sheet5[Static])
RETURN
IF(
x <0,
0,
x
)
Measure 3 =
CALCULATE(
[Measure 2],
FILTER(
ALLSELECTED(Sheet5),
Sheet5[Index] = MAX(Sheet5[Index]) - 1 && Sheet5[Person] = MAX(Sheet5[Person])
)
)
3. Create a measure again
Calculation =
VAR x = MAX(Sheet5[Revenue]) - MAX(Sheet5[Static])
RETURN
x + [Measure 3]
Although my data is the same as yours, but I started taking values from October 2017, so the returned results are different.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
StepanResl
6 years agoFrequent Visitor
Hey,
thank you for your help, but unfortunately it isnt calculated right. In your Third row should be 1200 and then in fourth should be 1200+500 = 1700.
But thank you for your help. I am trying it same way, but i cannt figurite out, how to provide right results.
Kind Regards,
Steve
- Anonymous6 years agoNot applicableHi StepanResl.
Please do not try to squeeze a round peg into a square hole or... the other way round.
Use Power Query for this as this is the right tool, not DAX.
Best
D