Rolling calender in Power BI

IhabSan

New Member
Joined
Mar 2, 2023
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
I get this erroe when I am trying to type this code "Expression.Error: The name Source was not recognized. Check that it is spelled correctly."

= List.Dates (Source, Number.From(DateTime.LocalNow()) - Number.From(Source), #duration(1,0,0,0))

I tried many times with source but does not work
=#date(2015, 1, 1)
=#date(2015-1-1)
=#date(2015/ 1/ 1)
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
The syntax for List.Dates is
Power Query:
List.Dates( start as date, count as number, step as duration) as list
for example:
Power Query:
List.Dates(#date(2011, 12, 31), 5, #duration(1, 0, 0, 0))
That will result in a list of Dates from 12/31/2011 to 01/04/2012. If you load the list to a table or convert it to a table, the values in the table will be numbers like 40908 for 12/31/2011, but will show correctly as dates when formatted as Date.
The above comes from the Power Query M formula language. A link to download the PDF is at the bottom left of the page.
 
Upvote 0

Forum statistics

Threads
1,223,959
Messages
6,175,647
Members
452,663
Latest member
MEMEH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top