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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
koolsid786
Frequent Visitor

M Query - List.Dates(#date(2020,05,31), 365, #duration(1,0,0,0))

Hello Team,

 

Can someone help me understanding how the above command will work and if in Duration (1,0,0,0) if I replace 1 by 2 or 3 what will happen ? 

 

My understanding  - above will create a column with date starting from May 31, 2020 and will last till 1 year and will have date as May 31, 2020 , June 1, 2020, June 2, 2020 etc.. as the duration has 1 day  if I change it to 2 it would be May 31, 2020, June 2, 2020, June 4, 2020 

 

Is the understanding correct ? 

2 ACCEPTED SOLUTIONS
m_dekorte
Super User
Super User

Hi @koolsid786 

 

For the most part your assumptions are right. It will create a list with dates starting May 31, 2020

The second argument is a count and the third step as duration. When you incease the step from 1 to 2 days a list will be generated with 365 list items, making the end date or last list item May 5, 2022 

 

Please mark this answer as solution when it helped you to resolve your question, thanks!

View solution in original post

4 REPLIES 4
ppm1
Solution Sage
Solution Sage

Your explanation is correct. The first value in #duration is days. Also, FYI that people typically use this approach to dynamically get the right count to make sure they get 1 year (leap year, etc.).

 

= List.Dates(#date(2020,05,31), Duration.TotalDays(#date(2021,6,1)-#date(2020,5,31)), #duration(1,0,0,0))

 

Pat

Microsoft Employee
m_dekorte
Super User
Super User

Hi @koolsid786 

 

For the most part your assumptions are right. It will create a list with dates starting May 31, 2020

The second argument is a count and the third step as duration. When you incease the step from 1 to 2 days a list will be generated with 365 list items, making the end date or last list item May 5, 2022 

 

Please mark this answer as solution when it helped you to resolve your question, thanks!

@m_dekorte  why the end date would be May 5, 2022

See here

m_dekorte_0-1682234256819.png

 

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.