Forum Discussion

jabrillo's avatar
jabrillo
Helper I
3 years ago
Solved

Matrix - Wrong Total

I want to create this matrix:

 Q1Q2Q3Q4Total
Planned1010101040
Actual57  12
Estimate by EOY57101032

 

Data

 

Planned Table

ProjectQuarterResourcePlannedAmount
P1Q1A5
P1Q1B5
P1Q2A5
P1Q2B5
P1Q3A5
P1Q3B5
P1Q4A5
P1Q4B5

 

Actual Table

ProjectQuarterResourceActualAmount
P1Q1A3
P1Q1B2
P1Q2A3
P1Q2B4

 

Matrix

 

Column = Quarter

Rows:

   Planned = sum(PlannedAmount)

   Actual = sum(ActualAmout)

   Estimate by EOY = if([Actual] > 0, [Actual], [Planned])

 

My Total Estimate by EOY is showing 12, instead of 32. Any suggestions would be appreciated. Thank you. 

  • Hi jabrillo 

    You can try

    Estimate by EOY =
    SUMX (
        VALUES ( TableName[Quarter] ),
        CALCULATE ( IF ( [Actual] > 0, [Actual], [Planned] ) )
    )

     

2 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi jabrillo 

    You can try

    Estimate by EOY =
    SUMX (
        VALUES ( TableName[Quarter] ),
        CALCULATE ( IF ( [Actual] > 0, [Actual], [Planned] ) )
    )