Forum Discussion
Help! :( Dynamic Weighted Average based on Revenue
- 8 years ago
Hi,
For the Weighted Amt, the measure should be:
=IF(HASONEVALUE(Data[Prod]),[Price] * [% of Total],SUMX(SUMMARIZE(VALUES(Data[Prod]),Data[Prod],"ABCD",[Price] * [% of Total]),[ABCD]))
Hope this helps.
Hi,
For the Weighted Amt, the measure should be:
=IF(HASONEVALUE(Data[Prod]),[Price] * [% of Total],SUMX(SUMMARIZE(VALUES(Data[Prod]),Data[Prod],"ABCD",[Price] * [% of Total]),[ABCD]))
Hope this helps.
- slashfemme8 years agoHelper I
I've never been so excited to get to work on a Monday to test a formula. :) Thank you, Ashish_Mathur! This formula appears to have worked correctly over different slicers. (Attached image showing measure at work named TEST WAV.)
The only thing I had a question about is the "ABCD" reference. I believe this is for the individual products, but in my case I have hundreds of products in different categories. I kept in the "ABCD" reference and it still worked, but curious as to what it is for.
Thank you again!
- Ashish_Mathur8 years agoSuper User
You are most welcome. ABCD is the just the title of a new virtual column that i have inserted via the SUMMARIZE() function. Down that column, i am simply multiplying Price and the % . Instead of ABCD, type any other relevant heading.
Hope this helps.
- slashfemme8 years agoHelper I
Thank you so much for clarifying! Now this function makes sense to me, and I can't wait to use it elsewhere now that I know how to use it. :)