Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculating $ and % Variance in DAX

I'm struggling to get something really simple correct here. 

 

Current Matrix:

FinancialsActualsForecastVAR $VAR %
Revenue$9,375,398 $10,119,803($744,405)-7.4%
EBITDA($523,357) ($358,524)($164,833)46%

 

Desired Matrix:

FinancialsActualsForecastVAR $VAR %
Revenue$9,375,398 $10,119,803($744,405)-7.4%
EBITDA($523,357) ($358,524)($164,833)-46%

 

Actuals, Forecast, VAR $ and VAR % are all calculated measures; only the Revneue and EBITDA Row Headers are values from an imported table. I want the VAR % to be negative when comparing the variance of two negative figures; for example in the first table the VAR % vs the Forecast is -46%, since $164k is roughly 46% of $358k. 

 

VAR % Measure:

VAR % = DIVIDE([VAR $], [Forecast])

 

The measure, ideally, should calculate the variance for the row values of "Revenue" and "EBITDA" in the Financials. 

 

Any ideas? 

  • tamerj1's avatar
    tamerj1
    4 years ago

    Anonymous 
    You are 100% correct. Please try

    VAR % =
    DIVIDE ( [VAR $], ABS ( [Forecast] ) )

3 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi Anonymous 
    Please use 

    VAR % =
    - ABS ( DIVIDE ( [VAR $], [Forecast] ) )
    • Anonymous's avatar
      Anonymous
      Not applicable

      This doesn't work; it renders positive amounts negative when the $ variance is positive, which is incorrect. 

      • tamerj1's avatar
        tamerj1
        Community Champion

        Anonymous 
        You are 100% correct. Please try

        VAR % =
        DIVIDE ( [VAR $], ABS ( [Forecast] ) )