A rule of thumb I've heard concerning pairing (sweet) wine with (sweet) desserts is that the wine should be sweeter than the dessert. For some references, see e.g., here or here.
So suppose I'm serving a sweet dessert but I only have an intuitive feeling of how sweet it is. When picking suitable wine for it, I can look at its sugar content, but how can I match it against the supposed sweetness of the dessert? I can also imagine this can be overdone by always going for the extremely sweet wine.
Ideally, I think I would be looking for a guideline like "dessert of type x, go for a wine with at around y grams of sugar in a liter" and so on.