Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Retrieving value for specific date

Hi,

 

I am looking to retrieve a value specifically from 7 days ago to compare it to the LASTDAY in the dataset. I cant seem to get it to work without having the formual sum the past 7 days. 

1 Reply

  • Hi Anonymous 

     

    Try to create a measure like this:

    7DaysAgo =
    VAR _A =
        LASTDATE ( table[date column] )
    VAR _B = _A - 7
    RETURN
        CALCULATE (
            SUM ( table[value column] ),
            FILTER ( ALL ( table ), table[date column] = _B )
        )



    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/