Forum Discussion

Kyle_Escosia's avatar
Kyle_Escosia
Frequent Visitor
7 years ago
Solved

Growth Rate % Change

I'm working on a data visualization on STOCK MARKET TRADES and I need to calculate the Average Growth Rate of the Stock daily. But the catch is, that they don't always deal everyday. They only do ...
  • v-lili6-msft's avatar
    7 years ago

    hi, Kyle_Escosia

    Whether there is no Saturday and Sunday in your date.

    If so, you could try this way:

    Add an index column by date column.

    Then try this formula to create a measure:

    yesterday2 = 
    CALCULATE (
        [2day],
        FILTER ( ALL ( 'sample' ), MAX ( 'sample'[Index] ) - 1 = 'sample'[Index] )
    )

    If you want use other fields in  slicer, you could use ALLEXCEPT instead of ALL.

    for example:

    FILTER ( ALLEXCEPT ( 'sample' , 'sample'[Code] ), MAX ( 'sample'[Index] ) - 1 = 'sample'[Index] )

    Result:

     

    Best Regards,

    Lin