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
Giada_Togliatti
Post Patron
Post Patron

total in average weight

Hi,

I have a column called average weight that is score*weight

 

Immagine.png

On total of column score*weight I need to have the sum of score weight divided by the sum of weight  (5,20/1,40)= 3,71

This should work for each selection, how can I do?

Thank you

1 ACCEPTED SOLUTION
ekoland88
Frequent Visitor

I did 4 measures:

 

_Score = SUM('test 2'[Score])

_Weight = SUM('test 2'[Weight])

Score Weight = SUMX('test 2',[_Score]*[_Weight])

Your Measure = IF(ISFILTERED('test 2'[Q ID]),[Score Weight],[Score Weight]/[_Weight])

 

 

The outcome:

Community 2.PNG

 

View solution in original post

6 REPLIES 6
ekoland88
Frequent Visitor

I did 4 measures:

 

_Score = SUM('test 2'[Score])

_Weight = SUM('test 2'[Weight])

Score Weight = SUMX('test 2',[_Score]*[_Weight])

Your Measure = IF(ISFILTERED('test 2'[Q ID]),[Score Weight],[Score Weight]/[_Weight])

 

 

The outcome:

Community 2.PNG

 

derrick777
Frequent Visitor

Since the total row is calculated the same way as the rows (just has another evaluation context), you cannot achieve exactly what you asked for. But you can create and show a measure which fullfills your requirements, like
Total Score*Weight := DIVIDE ( SUM ( 'Table'[Score*Weight] ), SUM ( 'Table'[Weight] ) )

@derrick777 , I've tried but it gives me a wrong result in all rows except total

 

Immagine.png

I thought this is what you want to achieve? Please define your requirements more precise.

@derrick777 , I need to divide only the total, what I need are these values:

 

1,20-0,9-1,50-1,20- 1,40 and total 3,71 but I don't know if it's possible to realize

@ekoland88provided the solution

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.