Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculations with missing data

Hi, I have got a simple table of student attendance (around 50 rows) looking as follows:   CourseGroup CourseCode Period 1 - Actual Period 1 - Target Period B - Actual Period B - Target P...
  • hnguy71's avatar
    6 years ago

    Anonymous 
    I think there's a fundamental thing you have to do with your data modeling first. Unpivot your data into similar fashion:

    Next, you need to create generic measures:

    TotalValue = SUM(School[Value])
    
    Actuals = CALCULATE([TotalValue], School[Attribute] = "Actual") 
    
    Targets = CALCULATE([TotalValue], School[Attribute] = "Target") 
    
    Delta = DIVIDE([Actuals], [Targets])

    And you should be able to achieve your desired results:

    If this is not the answer you were looking for please let me know.