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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Reut_123
New Member

weighted Avg

hi i'm trying to create a weighted avg 

 
 
 

 the calcultion should be per major gener - (imdb rating*imdb vote)/sum(imdb vote)

i try to do this:

 

Measure = 
 VAR X = SUMMARIZE(imdb2,imdb2[Major Genre],"sum",DIVIDE((SUM(imdb2[IMDB Rating])),SUM(imdb2[IMDB Votes]),ALLEXCEPT(imdb2,imdb2[Major Genre]))
 )
RETURN 
IF(HASONEVALUE(imdb2[Major Genre]),CALCULATE(SUM(imdb2[IMDB Votes]),SUMX(X,[sum]*imdb2[M_Profit])))

 

i got this error - The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

 

1 ACCEPTED SOLUTION
AntrikshSharma
Super User
Super User

@Reut_123  Few things are incorrect here:

ALLEXCEPT is a table function as well as a CALCULATE modifier, the way you are using it is incorrect.

Use of SUMX is incorrect, CALCULATE's 2nd argument onwards can only take boolean operations, tables, or CALCULATE modifiers.

 

Unfortunately writing about these 2 points will take a lot of pages so its not possible to explain the issue, so you will have to read the documentation.

View solution in original post

1 REPLY 1
AntrikshSharma
Super User
Super User

@Reut_123  Few things are incorrect here:

ALLEXCEPT is a table function as well as a CALCULATE modifier, the way you are using it is incorrect.

Use of SUMX is incorrect, CALCULATE's 2nd argument onwards can only take boolean operations, tables, or CALCULATE modifiers.

 

Unfortunately writing about these 2 points will take a lot of pages so its not possible to explain the issue, so you will have to read the documentation.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.