We present a definition of spectral flow for any norm closed ideal J in any von Neumann algebra N. Given a path of selfadjoint operators in N which are invertible in N/J, the spectral flow produces a class in Ko(J).
Given a semifinite spectral triple (A, H, D) relative to (N, τ) with A separable, we construct a class [D] ∈ KK1(A, K(N)). For a unitary u ∈ A, the von Neumann spectral flow between D and u*Du is equal to the Kasparov product [u]A[D], and is simply related to the numerical spectral flow, and a refined C*-spectral flow.