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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
SuperJK5088
Frequent Visitor

Expand to full list of dates with only Month and Year

Hi PBI Grurs! 

I have a table with month and year columns. How can I transform the table to have a new column with dates of every day?

 

Please see screenshot. The code is only giving me the first day of each month in "Date" column. For example, if the month is 1 and year is 2023, I need to date column to have 1/1/2023 - 1/31/2023 in row levels. 

 

Please help - TIA!

 

SuperJK5088_0-1722471717004.png

 

 

2 ACCEPTED SOLUTIONS
adudani
Super User
Super User

hi @SuperJK5088 ,

after converting the "Date" Column to type date.

using the "add column" ribbon -> from "date & time" -> date-> end of month.

 

use list.dates to get a list of dates from a start dat and end date as shown in this reference below:

 

https://www.youtube.com/watch?v=s_ClydymBW4&t=1s 

 

if you have any issues, kindly provide a sample input and for further resolution

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

View solution in original post

Chewdata
Super User
Super User

Hey,

You can use the following code for a custom column and then expand the list.

= Table.AddColumn(#"Changed Type", "ListDates", each List.Dates(
#date([Year], [Month], 1),
Duration.Days(
Date.EndOfMonth(#date([Year], [Month], 1)) - #date([Year], [Month], 1)) + 1, #duration(1,0,0,0)))

View solution in original post

2 REPLIES 2
Chewdata
Super User
Super User

Hey,

You can use the following code for a custom column and then expand the list.

= Table.AddColumn(#"Changed Type", "ListDates", each List.Dates(
#date([Year], [Month], 1),
Duration.Days(
Date.EndOfMonth(#date([Year], [Month], 1)) - #date([Year], [Month], 1)) + 1, #duration(1,0,0,0)))

adudani
Super User
Super User

hi @SuperJK5088 ,

after converting the "Date" Column to type date.

using the "add column" ribbon -> from "date & time" -> date-> end of month.

 

use list.dates to get a list of dates from a start dat and end date as shown in this reference below:

 

https://www.youtube.com/watch?v=s_ClydymBW4&t=1s 

 

if you have any issues, kindly provide a sample input and for further resolution

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

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.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.