Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PPerera
New Member

Need help to write a WAVG calc using DAX

Hi 

 

Please help me to write this WAVG Price formula using DAX

 

Sum( Price * ABS(MV) ) / Sum( CASE(Price = 0 , 0 ,ABS(MV) )

 

Assume Price and MV come from table "Sales"

 

Thanks

1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @PPerera 

 

maybe something like this (not sure if this works since i dont test this DAX).

DIVIDE(
   SUMX(

      'Sales',

      'Sales'[Price]*ABS('Sales'[MV])
   ),

   SUMX(

      FILTER(

         'Sales',

         'Sales'[Price]>0
      ),

      ABS('Sales'[MV])
   )
)

 

Hope this will help.

Thank you.

View solution in original post

3 REPLIES 3
Irwan
Super User
Super User

hello @PPerera 

 

maybe something like this (not sure if this works since i dont test this DAX).

DIVIDE(
   SUMX(

      'Sales',

      'Sales'[Price]*ABS('Sales'[MV])
   ),

   SUMX(

      FILTER(

         'Sales',

         'Sales'[Price]>0
      ),

      ABS('Sales'[MV])
   )
)

 

Hope this will help.

Thank you.

Thank you very much Irwan. It worked. This forum is full of great experts. This was my second question and got the answer almost immediately. Thanks again.

hello @PPerera 

 

glad to be a help.

Thank you.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.