Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
carenel
Frequent 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.

 

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

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

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

 

Picture1.png

 

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

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

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

 

Picture1.png

 

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

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

many thanks JiHwan,

 

Cheers

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors