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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.