This question already has an answer here:
When writing I normally don't care if I write first the caption or the label of a figure. A friend recently told me to write always the caption first and then the label.
What reasons are to do this? Are there any advantages by writing it this way?