Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Hierarchy Subtract

Hello.

I'm having a table with a field Version, up to now it only holds 2 values, 1 or 2 (this is used to compare measures).

But I would now like to define a 3rd value that subtracts the 2 values from the 1 values.

But not on each KPI (we have over 180 measures in our cube).

In Cognos TM1 we could cretae a consolidation of 1 and 2 and gibe weights of 1 and -1.

Anything posible in DAX ?

2 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Ok, let say this is the table, this table is used in a filtering system where users can compare 2 versions of a complete set of facts. There is a many-tomanu relationship (intermed table) on SelKey to the facts.

      I would like to be able to create a calculated 'version' (ex) 3 that has the formula CompVersion-Value-1 minus CompVersion-Value-2, but that should work on all KPI's. Creating a Hierarchy on Compversion with a element above would sum both, I would like to subtract one ...

      CompVersionSelKeyDim1Dim2Dim3Dim4Dim5
      11Plan1XX OK01/02/2018
      12Plan1XX OK02/02/2018
      13Plan1 X123 01/02/2018
      14Plan1XY NOK01/02/2018
      15Plan1XY NOK02/02/2018
      16Plan2ZZ  01/03/2018
      17Plan2ZZ  02/03/2018
      18Plan3ZZ  01/01/2017
      19Plan4   01/01/2018
      21Plan1XX OK01/02/2018
      22Plan1XX OK02/02/2018
      23Plan1 X123 01/02/2018
      24Plan1XY NOK01/02/2018
      25Plan1XY NOK02/02/2018
      26Plan2ZZ  01/03/2018
      27Plan2ZZ  02/03/2018
      28Plan3ZZ  01/01/2017
      29Plan4   01/01/2018