This measure is casuing my Power BI desktop file to freeze and will not calculate, even after waiting 10+ minutes. It is using other measures (Weighted, and GcommunityIndex) which I think might be causing the problem, however, those measures load very quickly when I add them to their own visual. I am trying to create a weighted average of the 'Weighted' measure while grouping by the Affiliation Level II and Code fields. Does anyone know why this might be causing my file to fail, or any solutions that might be better?
If you're iterating a fact table, then beware of such things. You're doing a context transition on probably 100's of rows or more. Hence your problems. You should first understand well how DAX works and only then try to write measures. Good advice, mate.
Grab a book on DAX (best one but very technical is "The Ultimate Guide to DAX" by The Italians) and read upon context transition and how NOT TO WRITE DAX.