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
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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors