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
Anonymous
Not applicable

Generate rows from date to date by brand and Goal

HI guys,

I have this table from my dataset having four columns

Brand       Percent Goal   From_date   To_date

1              0.20                  1/1/2022     1/4/2022

2              0.30                  1/1/2022      1/2/2022

2              0.25                  1/3/2022      1/4/2022

 

Code for generate  table

#table(
{"Brand", "Percent Goal", "From_date","To_date"},
{
{1,0.20, #date(2022,1,1),#date(2022,1,4)},
{2,0.30, #date(2022,1,1),#date(2022,1,2)},
{2,0.25, #date(2022,1,3),#date(2022,1,4)}
}
)

 

How can I get this results in power query editor:

Brand       Percent Goal   Date   

1              0.20                  1/1/2022 

1              0.20                  1/2/2022

1              0.20                  1/3/2022

1              0.20                  1/4/2022

2              0.30                  1/1/2022 

2              0.30                  1/2/2022

2              0.25                  1/3/2022

2              0.25                  1/4/2022

 

Code for desired output:

#table(
{"Brand", "Percent Goal", "Date"},
{
{1,0.20, #date(2022,1,1)},
{1,0.20, #date(2022,1,2)},
{1,0.20, #date(2022,1,3)},
{1,0.20, #date(2022,1,4)},
{2,0.30, #date(2022,1,1)},
{2,0.30, #date(2022,1,2)},
{2,0.25, #date(2022,1,3)},
{2,0.25, #date(2022,1,4)}
}
)

 

I'm sorry I don't know how to upload a sample

 

Thanks for your time

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

In Power Query, add a column similar to this:

{Number.From([StartDate])..Number.From([EndDate])}

Expand the List then change the type to date.

 

Good luck

View solution in original post

6 REPLIES 6
HotChilli
Super User
Super User

I don't understand what you are telling me.

Have you tried adding the column?

Ashish_Mathur
Super User
Super User

Hi,

Is the Date in dd/mm/yyyy format or mm/dd/yyyy?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi

@Ashish_Mathur  date format is mm/dd/yyyy

 

Thanks

Hi,

In that case HotChilli's solution should work fine for you.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
HotChilli
Super User
Super User

In Power Query, add a column similar to this:

{Number.From([StartDate])..Number.From([EndDate])}

Expand the List then change the type to date.

 

Good luck

Anonymous
Not applicable

Hi @HotChilli 

 

I have two other colums in my table, brand and Percent Goal, and dates may repete depending on Brand.

Percent Goal may be different depending on date as well

 

Thanks

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 Solution Authors