Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Weighting average - using variable metrics and variable contracts (Weighted / Balance Scorecard)

This is a rather complex / challenging query. So I’m hoping for can pick up the gauntlet and really help me here.   We have a hierarchal measurement system in place for our supplier. Which I hope t...
  • MFelix's avatar
    5 years ago

    Hi Anonymous ,

     

    There is one detail in this that I don't really understand you want to have the mockup table or not?

     

    Using the mockup table with the scores you need to create the following measures (I have made them for Imperative but you can then change them to Theme and Measure):

     

    Scored = COUNTROWS(FILTER('Mock up', 'Mock up'[Score] <> BLANK()))
    
    Weight imperative = 
    SWITCH (
        TRUE (),
        ISINSCOPE ( 'Mock up'[Imperative] ),
            DISTINCTCOUNT ( 'Mock up'[Imperative] )
                / CALCULATE (
                    DISTINCTCOUNT ( 'Mock up'[Imperative] ),
                    ALLSELECTED ( 'Mock up'[Imperative] ),
                    'Mock up'[Score] <> BLANK ()
                ), ISINSCOPE('Mock up'[Theme Name]),
        DISTINCTCOUNT ( 'Mock up'[Theme Name] )
            / CALCULATE (
                DISTINCTCOUNT ( 'Mock up'[Theme Name] ),
                ALLSELECTED ( 'Mock up'[Theme Name] ),
                'Mock up'[Score] <> BLANK ()
            ),
       
            DISTINCTCOUNT ( 'Mock up'[Measure Name] )
                 / CALCULATE (
                    COUNT ( 'Mock up'[Measure Name] ),
                    ALLSELECTED ( 'Mock up'[Measure Name] ),
                     'Mock up'[Score] > 0 
                )
     
    )
    
    Metric Imperative = if([Scored] = BLANK(), BLANK(), [Weight imperative]/[Scored] )

     

    For the last column with the averages I created the follwoing meaures:

    Score_Average = AVERAGE('Mock up'[Score])
    
    Average Score Imperative = 
    IF(ISFILTERED('Mock up'[Imperative]), [Score_Average], AVERAGEX( ALLSELECTED('Mock up'[Imperative]), [Score_Average])
    
    Average Score Theme = 
    IF(ISFILTERED('Mock up'[Theme Name]), [Score_Average], AVERAGEX( ALLSELECTED('Mock up'[Theme Name]), [Score_Average])
    )
    
    Average Score MEasure = 
    IF(ISFILTERED('Mock up'[Measure Name]), [Score_Average], AVERAGEX( ALLSELECTED('Mock up'[Measure Name]), [Score_Average])
    )
    

     

    Check result in attach PBIX.