Forum Discussion
manipulating cells in power bi
- 9 years ago
Hi habibcss,
If I understand you correctly, you should be able to follow steps below to get your expected result.:smileyhappy:
I assume you have a table called "Table1" like below.
1. Add an Index Column for your table within Query Editor under Add Column tab.
2. Then you should be able to use the formula below to create a new calculate column in the table to get your expected result.
Column = VAR currentIndex = Table1[Index] VAR currentValue = Table1[Value] RETURN IF ( currentIndex = 0, 0, currentValue - CALCULATE ( MAX ( Table1[Value] ), FILTER ( ALL ( Table1 ), Table1[Index] = currentIndex - 1 ) ) )Regards
Hi habibcss,
If I understand you correctly, you should be able to follow steps below to get your expected result.:smileyhappy:
I assume you have a table called "Table1" like below.
1. Add an Index Column for your table within Query Editor under Add Column tab.
2. Then you should be able to use the formula below to create a new calculate column in the table to get your expected result.
Column =
VAR currentIndex = Table1[Index]
VAR currentValue = Table1[Value]
RETURN
IF (
currentIndex = 0,
0,
currentValue
- CALCULATE (
MAX ( Table1[Value] ),
FILTER ( ALL ( Table1 ), Table1[Index] = currentIndex - 1 )
)
)
Regards