Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

EARLIER function not working

I have the following problem:   There is a table column with quarterly metreage called Total. However, it is reported not quarterly but as YTD (Q2 will report Q1+Q2, Q3 will report everything since...
  • v-cherch-msft's avatar
    v-cherch-msft
    7 years ago

    Hi Anonymous

     

    You may refer to below measure. Please let me know if it matches your request or not.

    Year = RIGHT(Drilling[Quarter],4)
    total2 =
    CALCULATE (
        SUM ( Drilling[Development] ),
        FILTER (
            Drilling,
            Drilling[Year] = EARLIER ( Drilling[Year] )
                && Drilling[Quarter] <= EARLIER ( Drilling[Quarter] )
        )
    )

     

    Regards,

    Cherie