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
Anonymous
Not applicable

Sumproduct by groups in power bi

Hey Guys, 

 

I have created a measure to do a weighted average for one of my metric, i have used summarized and as expected the performance has just been bad. Any suggestions on how i can improve the below query:

 

 

## Sumx Retail OOS =

var Retail_AGG_OOS = SUMX(SUMMARIZE(pbi_sc_buy_box, DIM_ASIN[ASIN],pbi_sc_buy_box[brand_key], "SUMPROD",[## Retail OSS]*[## 90 day retail cogs]), [SUMPROD])

return DIVIDE(Retail_AGG_OOS,[## 90 day retail cogs],0)


[## Retail OSS] and [## 90 day retail cogs] are also measures but simple ones. If further explanation is required, please feel free to ask. 
 
Thanks

 

4 REPLIES 4
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous 

Please have a look at below article to check if it could help you.

https://www.sqlbi.com/articles/optimizing-dax-expressions-involving-multiple-measures/

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous 

Sample data and expected output will be helpful to provide an accurate solution.

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hey

 

unfortunately, i couldn't provide the sample data or a pbix file. Although i was able to solve the issue by using groupby and addcolumns instead of summarize. 

 

For anyone struggling with summarize should definitely check out this article: https://www.sqlbi.com/articles/nested-grouping-using-groupby-vs-summarize/

 

Thanks

Anonymous
Not applicable

Thanks @v-cherch-msft. Nice article although it didnt help in my case. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.