Forum Discussion

PSampras's avatar
PSampras
Frequent Visitor
3 years ago
Solved

Measure Total value: change the default behaviour

Hi everyone,

i have a problem with a total value of a measure.

 

"Δ su Budget" measure value is correct in row context.
Δ su Budget = divide(sum(FACT_PL_FATTURATO[IMPNETTO])-[ImpNettoAp],[ImpNettoAp])

 

 

Total column is calculated as average of row's measure value (175,93 %)

There is a way to calculate total with the same row logica?
I want: (1.328.128,36 - 1.145.231,18) / 1.145.231,18 = 0,1597 (15,97 % in percentage).

Thanks for the help!!

Giuseppe

 

  • hnguy71's avatar
    hnguy71
    3 years ago

    PSampras ,

     

    You may be able to get it using a similar fashion:

     

    #Delta = 
    
    VAR _Actual = SUM('Table'[Actual])       // replace this with the sum of your actuals
    VAR _Budget = SUM('Table'[Budget])       // replace this with the sum of your budget
    VAR _Delta = SUM('Table'[Delta])         // replace this with your current measure -->  divide(sum(FACT_PL_FATTURATO[IMPNETTO])-[ImpNettoAp],[ImpNettoAp])
    
    RETURN
    
    // I selected classification but this value should be on your table somewhere. You can also interchange and use ISINSCOPE instead of HASONEFILTER
    IF( HASONEFILTER('Table'[Classification]), _Delta, DIVIDE(_Actual - _Budget, _Budget))

     

    Here's an example output:

     

4 Replies

    • hnguy71's avatar
      hnguy71
      Super User

      PSampras ,

       

      You may be able to get it using a similar fashion:

       

      #Delta = 
      
      VAR _Actual = SUM('Table'[Actual])       // replace this with the sum of your actuals
      VAR _Budget = SUM('Table'[Budget])       // replace this with the sum of your budget
      VAR _Delta = SUM('Table'[Delta])         // replace this with your current measure -->  divide(sum(FACT_PL_FATTURATO[IMPNETTO])-[ImpNettoAp],[ImpNettoAp])
      
      RETURN
      
      // I selected classification but this value should be on your table somewhere. You can also interchange and use ISINSCOPE instead of HASONEFILTER
      IF( HASONEFILTER('Table'[Classification]), _Delta, DIVIDE(_Actual - _Budget, _Budget))

       

      Here's an example output:

       

      • PSampras's avatar
        PSampras
        Frequent Visitor

        Thank you very much hnguy71 , it works!

         

        #Delta = 

        VAR _Actual = SUM(vods_facAgr_ITA[ImpNetto]) // replace this with the sum of your actuals
        VAR _Budget = SUM(vods_facAgr_ITA[ColBudgetRigaClassificatore]) // replace this with the sum of your budget
        VAR _Delta = divide(sum(vods_facAgr_ITA[ImpNetto])-sum(vods_facAgr_ITA[ColBudgetRigaClassificatore]),sum(vods_facAgr_ITA[ColBudgetRigaClassificatore])) // replace this with your current measure --> divide(sum(FACT_PL_FATTURATO[IMPNETTO])-[ImpNettoAp],[ImpNettoAp])

        RETURN
        // I selected classification but this value should be on your table somewhere. You can also interchange and use ISINSCOPE instead of HASONEFILTER
        IF( HASONEFILTER(vods_facAgr_ITA[Classificatore]), if(isblank(_Delta),1,_Delta), DIVIDE(_Actual - _Budget, _Budget))