A method for operating a wind farm comprising a plurality of wind turbines, which are operated to supply electrical power to a grid in accordance with at least one setpoint value for a power related electrical variable, the method comprising the steps of: ∘ Receiving a setpoint for a reactive power ( Q SP,WF) to be supplied by the wind farm, ∘ Determining a value of an available reactive power ( Q avail,WTj) of each wind turbine, ∘ Determining an available reactive power of the wind farm ( Q avail,WF) from the sum of the available reactive power of each wind turbine ( Q avail, WF: = ∑ j = 1 N Q avail, WTj), ∘ Comparing the available reactive power of the wind farm ( Q avail,WF) with the received setpoint for the reactive power ( Q SP,WF) for the wind farm, ∘ If the available reactive power of the wind farm ( Q avail,WF) is smaller than the received setpoint for the reactive power ( Q SP,WF) for the wind farm, ▪ Determining a required increase of the reactive power ( Δ Q WTj ∗) for at least one of the wind turbines based at least on the available reactive power of the wind farm ( Q avail,WF) and the setpoint for the reactive power for the wind farm ( Q SP,WF), ▪ Determining a setpoint for the reactive power ( Q SP,WTj) for each of the at least one of the wind turbines based at least on the available reactive power of said each wind turbine ( Q avail,WTj) and said required increase of the reactive power ( Δ Q WTj ∗), and ▪ Distributing at least one of the required increase of the reactive power ( Δ Q WTj ∗) and the setpoint for the reactive power ( Q SP,WTj) to each of the at least one of the wind turbines, ∘ wherein the required increase of reactive power ( Δ Q WTj ∗) of the at least one wind turbine is determined as a first fraction ( g j) of the difference of the setpoint for the reactive power for the wind farm ( Q SP,WF) and the available reactive power of the wind farm ( Q avail,WF): Δ Q WTj *: = g j Q SP, WF − Q avail, WF, characterized in that the first fraction ( g j) is determined from a sensitivity of the reactive power ( Q j) to the active power ( P j), wherein the first fraction ( g j) is proportional to the sensitivity. ∘ Receiving a setpoint for a reactive power ( Q SP,WF) to be supplied by the wind farm, ∘ Determining a value of an available reactive power ( Q avail,WTj) of each wind turbine, ∘ Determining an available reactive power of the wind farm ( Q avail,WF) from the sum of the available reactive power of each wind turbine ( Q avail, WF: = ∑ j = 1 N Q avail, WTj), ∘ Comparing the available reactive power of the wind farm ( Q avail,WF) with the received setpoint for the reactive power ( Q SP,WF) for the wind farm, ∘ If the available reactive power of the wind farm ( Q avail,WF) is smaller than the received setpoint for the reactive power ( Q SP,WF) for the wind farm, ▪ Determining a required increase of the reactive power ( Δ Q WTj ∗) for at least one of the wind turbines based at least on the available reactive power of the wind farm ( Q avail,WF) and the setpoint for the reactive power for the wind farm ( Q SP,WF), ▪ Determining a setpoint for the reactive power ( Q SP,WTj) for each of the at least one of the wind turbines based at least on the available reactive power of said each wind turbine ( Q avail,WTj) and said required increase of the reactive power ( Δ Q WTj ∗), and ▪ Distributing at least one of the required increase of the reactive power ( Δ Q WTj ∗) and the setpoint for the reactive power ( Q SP,WTj) to each of the at least one of the wind turbines, ▪ Determining a required increase of the reactive power ( Δ Q WTj ∗) for at least one of the wind turbines based at least on the available reactive power of the wind farm ( Q avail,WF) and the setpoint for the reactive power for the wind farm ( Q SP,WF), ▪ Determining a setpoint for the reactive power ( Q SP,WTj) for each of the at least one of the wind turbines based at least on the available reactive power of said each wind turbine ( Q avail,WTj) and said required increase of the reactive power ( Δ Q WTj ∗), and ▪ Distributing at least one of the required increase of the reactive power ( Δ Q WTj ∗) and the setpoint for the reactive power ( Q SP,WTj) to each of the at least one of the wind turbines, ∘ wherein the required increase of reactive power ( Δ Q WTj ∗) of the at least one wind turbine is determined as a first fraction ( g j) of the difference of the setpoint for the reactive power for the wind farm ( Q SP,WF) and the available reactive power of the wind farm ( Q avail,WF): Δ Q WTj *: = g j Q SP, WF − Q avail, WF,