Forum Discussion

UKNSI-Powerbi's avatar
UKNSI-Powerbi
Frequent Visitor
3 years ago
Solved

Row level variance

At the moment I have a table of customer cumulations grouped by  Cust/Seq/Contract/Part/Date/Release/YYYYMM   Cust Seq Contract Part Date Release Rev YYYYMM CUMULATION CUST1     1 0...
  • FreemanZ's avatar
    3 years ago

    hi UKNSI-Powerbi 

    you may try to add a calculated column like this:

    Variance2 = 
    VAR _date = [Date]
    VAR _cumpre =
    CALCULATE(
        SUM(TableName[CUMULATION]),    
        ALLEXCEPT(TableName, TableName[Cust], TableName[Seq], TableName[Contract], TableName[Part], TableName[YYYYMM]),
        TableName[Date] = _date-1
    )
    RETURN
    DIVIDE( [CUMULATION] - _cumpre, _cumpre)

     

    tried and it worked like this: