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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Display month names between two dates.

I have multiple projects whose start dates and end dates are given. I have created a column which specify how many months each project runs for.  Now I want to display all the monthnames the project is running for on new rws. Ex: Lets say Project A is runing for 5 months from January to May. Then there should be 5 rows created with all columns and the column that specifies the monthname. In these five rows, each row should be dedicated to a month being displayed in the monthname column.And this hs to be done in Power query. Request anybody to help with the aswer. Thanks in advance.

1 ACCEPTED SOLUTION
slorin
Super User
Super User

Hi, @Anonymous 

 

add a new column then expand into new rows

= Table.AddColumn(
Your_Source,
"Month_List",
each List.Distinct(
List.Transform(
{Number.From([Start_Date])..Number.From([End_Date])},
each Date.ToText(Date.From(_),"MMM-yy"))))

Stéphane 

View solution in original post

1 REPLY 1
slorin
Super User
Super User

Hi, @Anonymous 

 

add a new column then expand into new rows

= Table.AddColumn(
Your_Source,
"Month_List",
each List.Distinct(
List.Transform(
{Number.From([Start_Date])..Number.From([End_Date])},
each Date.ToText(Date.From(_),"MMM-yy"))))

Stéphane 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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