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.
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.
Solved! Go to Solution.
@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.
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
19 |