Forum Discussion
carenel
4 years agoFrequent Visitor
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.
| date | oil | initial | final result | |
| 01/01/2018 | 0,6754 | 03/01/2018 | 0,5377 | |
| 02/01/2018 | 0,0351 | 03/01/2018 | 0,5377 | |
| 03/01/2018 | 0,5377 | 03/01/2018 | 0,5377 | |
| 04/01/2018 | 0,5231 | 07/01/2018 | 0,5112 | |
| 05/01/2018 | 0,6754 | 07/01/2018 | 0,5112 | |
| 06/01/2018 | 0,8789 | 07/01/2018 | 0,5112 | |
| 07/01/2018 | 0,5112 | 07/01/2018 | 0,5112 | |
| 08/01/2018 | 0,2651 | 11/01/2018 | 0,6754 | |
| 09/01/2018 | 0,6754 | 11/01/2018 | 0,6754 | |
| 10/01/2018 | 0,1906 | 11/01/2018 | 0,6754 | |
| 11/01/2018 | 0,6754 | 11/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] )RETURNMAXX ( newtable, Data[oil] )
2 Replies
- Jihwan_KimSuper User
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] )RETURNMAXX ( newtable, Data[oil] )- carenelFrequent Visitor
many thanks JiHwan,
Cheers