Forum Discussion
Keep only first value rest put 0
- Anonymous8 years ago
Hi Pingu,
I think you still need to add an index column to calculate through table, type column obviously not suitable use as index column.
You can enter to query editor to add index column, then use below formula to replace qty value.
Replaced = IF ( [Index] > CALCULATE ( MIN ( Table1[Index] ), FILTER ( ALL ( Table1 ), Table1[Test Nr] = EARLIER ( Table1[Test Nr] ) ) ), 0, [Qty] )Regards,
Xiaoxin Sheng
I have:
Test Nr Qty DefType
t1 5 A
t1 5 P
t1 5 B
t1 5 T
t2 3 A
t2 3 B
I tried to create a new column:
Qty_simple = if(filter(Data;Data[test Nr]= EARLIER(Data[test Nr]));Qty;0)
but I get an error.
Hi Pingu,
I think you still need to add an index column to calculate through table, type column obviously not suitable use as index column.
You can enter to query editor to add index column, then use below formula to replace qty value.
Replaced =
IF (
[Index]
> CALCULATE (
MIN ( Table1[Index] ),
FILTER ( ALL ( Table1 ), Table1[Test Nr] = EARLIER ( Table1[Test Nr] ) )
),
0,
[Qty]
)
Regards,
Xiaoxin Sheng