Forum Discussion
Anonymous
4 years agoNot applicable
skip a row and rewrite the same values from 2nd row
Hello, I have a small question. I have a column X with 1 2 3 4 5 6 as numbers and i want a column to be added with Y as the same as X but 1st row should be skipped in Y when comparing to X. Like the...
- 4 years ago
Hi Anonymous ,
Test the below:
Table2 = DISTINCT(UNION( SELECTCOLUMNS('Table',"X",'Table'[X]),SELECTCOLUMNS('Table',"X",0)))Y = IF ( Table2[X]=0, CALCULATE(MAX(Table2[X]),ALL(Table2)), IF ( CALCULATE ( MAX ( 'Table2'[x] ), FILTER ( ALL ( Table2 ), Table2[x] < EARLIER ( Table2[X] ) ) ) = 0, BLANK (), CALCULATE ( MAX ( 'Table2'[x] ), FILTER ( ALL ( Table2 ), Table2[x] < EARLIER ( Table2[X] ) ) ) ) )Did I answer your question? Mark my post as a solution!
Best RegardsLucien
v-luwang-msft
Community Support
4 years agoHi Anonymous ,
Test the below:
Table2 = DISTINCT(UNION( SELECTCOLUMNS('Table',"X",'Table'[X]),SELECTCOLUMNS('Table',"X",0)))Y = IF (
Table2[X]=0,
CALCULATE(MAX(Table2[X]),ALL(Table2)),
IF (
CALCULATE (
MAX ( 'Table2'[x] ),
FILTER ( ALL ( Table2 ), Table2[x] < EARLIER ( Table2[X] ) )
) = 0,
BLANK (),
CALCULATE (
MAX ( 'Table2'[x] ),
FILTER ( ALL ( Table2 ), Table2[x] < EARLIER ( Table2[X] ) )
)
)
)
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien