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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
mattmattmatt
New Member

Create New Date/Month List based on Earliest and Last Dates in existing column

Hello,

 

This is my first time posting here (thanks in advance for your help). I would like to do two things:

1.) Create a new column to populate all dates (month-year), starting with the earliest date (Jan 2022) and going through largest date (August 2022). So it would have Jan, Feb, March...Aug 2022. I believe this is achieved with List.Generate but let me know if there is a better way.

2.) After creating this list, I need to create a "New Value" column which either (i) pulls the existing Value if the date existed in the original data, or alternatively (ii) if the data did not exist, then simply pull copy down the latest value that did exist. So in the below example, it would have 4.3 for Jan + Feb 2022, 4.5 for March - July 2022, and 4.7 for August 2022.

 

ValueDate
4.31/1/2022
4.53/1/2022
4.78/1/2022
  

 

Is this easy to build?

1 ACCEPTED SOLUTION
slorin
Super User
Super User

Hi @mattmattmatt 

 

let
Source = Your_Source,
List_Month = Table.FromColumns(
{List.Select(
List.Transform(
{Number.From(List.Min(Source[Date]))..Number.From(List.Max(Source[Date]))},
Date.From),
each Date.Day(_)=1)},
type table [Date = date]),
Join = Table.NestedJoin(List_Month, {"Date"}, Source, {"Date"}, "Source", JoinKind.LeftOuter),
Expand = Table.ExpandTableColumn(Join, "Source", {"Value"}, {"Value"}),
FillDown = Table.FillDown(Expand,{"Value"})
in
FillDown

 Stéphane

View solution in original post

2 REPLIES 2
mattmattmatt
New Member

Thank you @slorin ! I got it to work with your code.

slorin
Super User
Super User

Hi @mattmattmatt 

 

let
Source = Your_Source,
List_Month = Table.FromColumns(
{List.Select(
List.Transform(
{Number.From(List.Min(Source[Date]))..Number.From(List.Max(Source[Date]))},
Date.From),
each Date.Day(_)=1)},
type table [Date = date]),
Join = Table.NestedJoin(List_Month, {"Date"}, Source, {"Date"}, "Source", JoinKind.LeftOuter),
Expand = Table.ExpandTableColumn(Join, "Source", {"Value"}, {"Value"}),
FillDown = Table.FillDown(Expand,{"Value"})
in
FillDown

 Stéphane

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors