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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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