Forum Discussion

Pelle's avatar
Pelle
Frequent Visitor
8 years ago
Solved

Create a calculation with two different levels in a dimension table.

Hi. I need to do a calculation like this. Avg(value) for level1 DIVIDED Avg(value) for level2. Her is my data. dimension table:   fact table: I have created two different measurs: ...
  • v-piga-msft's avatar
    8 years ago

    Hi Pelle,

     

    You could try to modify your measure as below.

     

    Avg Value without Level1 =
    CALCULATE (
        AVERAGE ( 'fact'[Value] ),
        FILTER ( ALL ( dim ), 'dim'[Level2] = MAX ( 'dim'[Level2] ) )
    )

    And the result will be your expected output.

     

    Hope it can help you!

     

    Best Regards,

    Cherry