Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Dynamic Price Index based on Quarter

Hi,    I have a particular problem whereby i need to show a dynamic price index based on the latest quarter.    Back ground:   Now we are in 2019 Q2. I have the historical product cost from 201...
  • v-yuta-msft's avatar
    v-yuta-msft
    7 years ago

    Anonymous ,

     

    Modify the measure as below:

    Result = 
    VAR Current_Year = MAX('Table'[Year])
    VAR Current_Quarter = MAX('Table'[Quarter])
    VAR Start_Year = Current_Year - 1
    VAR Start_Quarter = Current_Quarter - 1
    RETURN
    CALCULATE(AVERAGE('Table'[Product Cost]), FILTER(ALLEXCEPT('Table', 'Table[Product]'), 'Table'[Year] >= Start_Year && 'Table'[Year] <= Current_Year && 'Table'[Quarter] >= Start_Quarter && 'Table'[Quarter] <= Current_Quarter))

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.