Forum Discussion

Nibz's avatar
Nibz
Helper I
9 years ago

DATE

Hello,

 

I have a problem to use multiply dates in the same table

 

 

In this exemple, all columns are based on the dates of my filter (from "01/06/2017" to "30/06/2017" in this exemple).

However, I need the 5th column named "Ecart d'inventaire" to be based on different dates. I need my calculation for this column to be based on 5 days before the end date of my filter and 5 days after. In this exemple, my dates for this column have to be from "25/06/2017" to "05/07/2017"

 

Is it possible ?

 

Many thanks for your help

1 Reply

  • Hi,

     

    I created a tablea with Date and Amount and created this measure (Test).

    It works for us know if you have any observations.

     

    Test  =
    VAR V1 =
        MAXA ( Data[Date] ) + 5
    VAR V2 =
        MINA ( Data[Date] ) - 5
    RETURN
        CALCULATE (
            SUM ( Data[Montant] ),
            FILTER ( ALL ( Data ), Data[Date] <= V1 && Data[Date] >= V2 )
        )