Forum Discussion

Giada_Togliatti's avatar
Giada_Togliatti
Post Patron
5 years ago
Solved

total in average weight

Hi,

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

 

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

  • 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:

     

6 Replies

  • ekoland88's avatar
    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:

     

  • 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's avatar
        derrick777
        Advocate I

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