Forum Discussion

carenel's avatar
carenel
Frequent Visitor
4 years ago
Solved

Search and fill previous dates with the same data

Hello community,

 

I want to create a new column with variables. The conditions are:

- if initial date = date  then the result is oil but it has to fill the previous dates with the same oil price.

 

dateoilinitial final result
01/01/20180,675403/01/2018 0,5377
02/01/20180,035103/01/2018 0,5377
03/01/20180,537703/01/2018 0,5377
04/01/20180,523107/01/2018 0,5112
05/01/20180,675407/01/2018 0,5112
06/01/20180,878907/01/2018 0,5112
07/01/20180,511207/01/2018 0,5112
08/01/20180,265111/01/2018 0,6754
09/01/20180,675411/01/2018 0,6754
10/01/20180,190611/01/2018 0,6754
11/01/20180,675411/01/2018 0,6754

 

Many thanks

  • Hi,

    Please check the below picture and the attached pbix file, that is for creating a new column.

     

     

    Final result CC =
    VAR newtable =
    FILTER ( SUMMARIZE ( Data, Data[date], Data[oil] ), Data[date] = Data[initial] )
    RETURN
    MAXX ( newtable, Data[oil] )

2 Replies

  • Hi,

    Please check the below picture and the attached pbix file, that is for creating a new column.

     

     

    Final result CC =
    VAR newtable =
    FILTER ( SUMMARIZE ( Data, Data[date], Data[oil] ), Data[date] = Data[initial] )
    RETURN
    MAXX ( newtable, Data[oil] )