Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am trying to replicate the following calculation in DAX, where I want to get the value from the previous row in the current column (B).
Solved! Go to Solution.
Hi @Anonymous
If B is a calculated column then
B =
SUMX (
FILTER ( 'Table', 'Table'[Index] <= EARLIER ( 'Table'[Index] ) ),
'Table'[A]
)
Hi @Anonymous
Please refer to attached sample file with the proposed solution
B =
COALESCE (
DIVIDE (
1,
PRODUCTX (
FILTER (
'Table',
'Table'[Index] <= EARLIER ( 'Table'[Index] )
&& 'Table'[Index] > 1
),
( 1 + 'Table'[A] ) ^ (1/16)
)
),
1
)
The numbers do not 100% match yours, but when I made the my own excel sample file, the numbers were 100% matching. Could it be a rounding error?
@Anonymous
Value =
COALESCE (
PRODUCTX (
FILTER (
Table2,
Table2[Index] <= EARLIER ( Table2[Index] )
&& Table2[Index] > 1
),
1 + Table2[A]
) * 100,
100
)
I have another similar issue.
Initial value in column C (C1) = 100
The following values in column C is: C_i (C_i where i > 1) = C_i-1 *(1+A_i)
Hi @Anonymous
If B is a calculated column then
B =
SUMX (
FILTER ( 'Table', 'Table'[Index] <= EARLIER ( 'Table'[Index] ) ),
'Table'[A]
)
That did work fine. What if I want to expand the complexity by the following, knowing that B1 = 1,
Hi @Anonymous
Please refer to attached sample file with the proposed solution
B =
COALESCE (
DIVIDE (
1,
PRODUCTX (
FILTER (
'Table',
'Table'[Index] <= EARLIER ( 'Table'[Index] )
&& 'Table'[Index] > 1
),
( 1 + 'Table'[A] ) ^ (1/16)
)
),
1
)
The numbers do not 100% match yours, but when I made the my own excel sample file, the numbers were 100% matching. Could it be a rounding error?
Amazing, and thank you so much for solving my issue! ❤️
@Anonymous
Ya that is pretty complex. I'll have a look at it tomorrow.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |