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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
akdoro
New Member

M Query : Create a table using input from another table

I have this table, let us call it 'tblSeasons'

 

 StartDate   EndDate   Season

02-05-20165-05-2016Round 0
11-05-201615-08-2016Round 1
21-08-201615-11-2016Round 2
16-11-201609-01-2017Round 3
10-01-201715-02-2017Round 4
01-04-201720-05-2017Round 0

 

 

I want to generate another table 'SeasonDetails' with continuous dates using the above table as the input parameter :

 

That is:

 

DateRound
02-05-2016Round 0
03-05-2016Round 0
04-05-2016Round 0
05-05-2016Round 0
11-05-2016Round 1
12-05-2016Round 1
13-05-2016Round 1
14-05-2016Round 1
15-05-2016Round 1

 

 

etc..

 

How do I go about this?

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

here you will find a little example (open the query editor).

 

Basically I added a custom column using this formula

List.Dates(
  [DateStart],
  Number.From([DateEnd]) - Number.From([DateStart]) + 1,
  #duration(1,0,0,0)
)

You have to make sure that your columns are date columns and have valid entries. My Formula does not consider any Data Quality check or similar stuff 🙂 The Formula creates a list.

 

The next step is: expand the list as new rows:

2017-07-11_22-24-20.png

 

Hope this helps



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

here you will find a little example (open the query editor).

 

Basically I added a custom column using this formula

List.Dates(
  [DateStart],
  Number.From([DateEnd]) - Number.From([DateStart]) + 1,
  #duration(1,0,0,0)
)

You have to make sure that your columns are date columns and have valid entries. My Formula does not consider any Data Quality check or similar stuff 🙂 The Formula creates a list.

 

The next step is: expand the list as new rows:

2017-07-11_22-24-20.png

 

Hope this helps



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

@TomMartens ThankYou! That works!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors