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

Pivot Two Dates in each day date

This is my data table, I want to convert the table from start and finish date, into vertical dates.
Zahid_shaikh22_0-1605794002311.png

I am not sure if the technical term to do this is called Pivoting.


Example:
Line 126, Task ID A3060 ,, Start date: 12/3/2018 ,, Finish date: 12/20/2018
Want to change that into:
A3060  12/3/2018

A3060  12/4/2018

A3060  12/5/2018

...until
A3060  12/20/2018

 

Also Most of the Task ID have Start and Finish dates, and some have only Start date or Finish date, not sure how that would affect

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

you can create a date table

Date = CALENDAR(min('Table'[Start]),max('Table'[End]))

then you can use DAX to create a new table

Table 2 = GENERATE('Table',FILTER('Date','Table'[End]>='Date'[Date]&&'Table'[Start]<='Date'[Date]))

I haven't tried this before, so I did test for blank for start date and end date.

1.PNG

It looks like test1 does not show up in the Table2 and test 2's start date will be the minimum date of date table.

2.png3.png

please see the attachment

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@Anonymous 

you can create a date table

Date = CALENDAR(min('Table'[Start]),max('Table'[End]))

then you can use DAX to create a new table

Table 2 = GENERATE('Table',FILTER('Date','Table'[End]>='Date'[Date]&&'Table'[Start]<='Date'[Date]))

I haven't tried this before, so I did test for blank for start date and end date.

1.PNG

It looks like test1 does not show up in the Table2 and test 2's start date will be the minimum date of date table.

2.png3.png

please see the attachment

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@Anonymous , Refer if the attached file after signature can help you.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak , Thank for the help.. The Dax you shared helped me in another project

Anonymous
Not applicable

@amitchandak , Thanks I took a dive in to the file you had shared with me, it has interesting result

Table 1.jpg


can we do this to the source table itself,
Taking example of the data table you have, can we change the dates into list format between these two dates..
data table.jpg
Change the above table itself to List type based on dates, For first value Start : 19-Mar-20, End: 1-Apr-20

ID | Date 

1   19-Mar-20 

1   20-Mar-20 

1   21-Mar-20

.....

1   1-Apr-20

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.