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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JGalvan
Frequent Visitor

How can I reproduce Excel SumProduct in Power BI

I am new to Power BI. I use Excel's SumProduct function to calculate a weighted average. I'm trying to do this using SUMX. However, I'm getting an error message regarding "multiple columns cannot be converted to a scalar value.

 

JGalvan_1-1628969356084.png

 

 

1 ACCEPTED SOLUTION

Hi @JGalvan ,

 

Your expression is for a calculated table,you need to create a table using that expression,and it will work fine:

vkellymsft_0-1629187068553.png

If you need a measure,using below expression;

Measure = SUMX(FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])),'Table'[Percentage]*'Table'[Vacrate])

And you will see:

vkellymsft_1-1629187179310.png

Check my sample .pbix file attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

View solution in original post

9 REPLIES 9
m3tr01d
Continued Contributor
Continued Contributor

@JGalvan What kind of visual in Power BI are you trying to make?

@m3tr01d 

I will eventually create a historical line chart with the vacancy rate (also going to get weighted average for other metrics) for the "weighted" value as one "market".

Hi @JGalvan ,

 

Your expression is for a calculated table,you need to create a table using that expression,and it will work fine:

vkellymsft_0-1629187068553.png

If you need a measure,using below expression;

Measure = SUMX(FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])),'Table'[Percentage]*'Table'[Vacrate])

And you will see:

vkellymsft_1-1629187179310.png

Check my sample .pbix file attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

This worked perfectly! Using the 'new table' suggestion, I was able to create an entire, historical data set on the 'new market' using the weighted averages for all the contributing submarkets.

 

Thank you @v-kelly-msft . I really appreciate it.

JGalvan
Frequent Visitor

Thank you all for your input. Per my original snippet, I am trying to group by Year and get a single value (which would be repeated in every row for the year) using the aggregated data. The single value = the weighted average data point for that year.

 

Thank you @Ashish_Mathur . I am still unclear on this issue. What I'm trying to get is a single value (using the aggregated "weighted average" of 29 contributors) for each year. That's why, in my original post image, I was trying to group by year in order to get a single value per year. Maybe this new image will help explain what I'm trying to do. I appreciate your input.

JGalvan_0-1629048078207.png

 

Hi,

In a slicer, select a certain year.  Drag this measure to a card visual

Measure = SUMX(VALUES(Data[Parts]),Data[Vacrate]*Data[Percentage])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Write the formula as a measure (not as a calculated column)

Measure = SUMX('sheet1','sheet1'[vacrate]*'sheet1'[Percentage])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
jdbuchanan71
Super User
Super User

@JGalvan 

A straight SUMX measure using the two columns is the same as excel SUMPRODUCT.

 

WTD vac = SUMX ( Sheet1, Sheet1[Vacrate] * Sheet1[Percentage] )

 

jdbuchanan71_1-1628970234127.png

jdbuchanan71_0-1629007001160.png

 

 

Thank you @jdbuchanan71  - I submitted another snippet below to further explain what I'm trying to do. 

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.

Top Solution Authors
Top Kudoed Authors