Forum Discussion
Adding JUNE Year Edn Financial Year reporting Columns to DATEDIM table
- Anonymous9 years ago
Is this the sort of thing you need: https://gqbi.wordpress.com/2016/09/13/power-bi-how-to-easily-create-dynamic-date-tabledimension-with-fiscal-attributes-using-power-query/
- Anonymous9 years ago
Garry,
That sample Power Query script extends the Date table per this line:
#"Invoked FunctionSource" = Source(#date(#"Start Year", 1, 1), Duration.Days(DateTime.Date(DateTime.FixedLocalNow()) - Date.AddDays(#date(#"Start Year",1,1),-1)), #duration(1, 0, 0, 0)),
I suggest you add an "End Year" parameter, and then amend the script line above to:
#"Invoked FunctionSource" = Source(#date(#"Start Year", 1, 1), Duration.Days(#date(#"End Year", 12, 30) - #date(#"Start Year",1,1)), #duration(1, 0, 1, 0)),
Then, if you set your "End Year" parameter to 2025, it should extend the Date table to 31/12/2025
Is this the sort of thing you need: https://gqbi.wordpress.com/2016/09/13/power-bi-how-to-easily-create-dynamic-date-tabledimension-with-fiscal-attributes-using-power-query/
I copied the download PBI file from your link...do you have any idea how to extent the date table or have a parameter to manage the End date for the table. My project data goes from 1/07/2013 to 30/06/2025..
The guide doesnt use a link for the end date so it is only showing 2014 to 2017 and groups the balance in a blank time period.
- Anonymous9 years agoNot applicable
Garry,
That sample Power Query script extends the Date table per this line:
#"Invoked FunctionSource" = Source(#date(#"Start Year", 1, 1), Duration.Days(DateTime.Date(DateTime.FixedLocalNow()) - Date.AddDays(#date(#"Start Year",1,1),-1)), #duration(1, 0, 0, 0)),
I suggest you add an "End Year" parameter, and then amend the script line above to:
#"Invoked FunctionSource" = Source(#date(#"Start Year", 1, 1), Duration.Days(#date(#"End Year", 12, 30) - #date(#"Start Year",1,1)), #duration(1, 0, 1, 0)),
Then, if you set your "End Year" parameter to 2025, it should extend the Date table to 31/12/2025
- TheG9 years ago
Advocate I
Brillant, it worked a treat ...thanks so much...This is the easiest way so far to create this Financial table so far..
The original poster gave me this advice ..
you can change the following line as shown below
#”Invoked FunctionSource” = Source(#date(#”Start Year”, 1, 1), Duration.Days(DateTime.Date(Date.AddYears(DateTime.FixedLocalNow(),+10)) – #date(#”Start Year”,1,1)), #duration(1, 0, 0, 0)),
Please notice above where there is the +10 this adds 10 years from today’s date.
i get a token Identifier expected error in regards to #duration
Here is cut and paste of the line#”Invoked FunctionSource” = Source(#date(#”Start Year”, 1, 1), Duration.Days(DateTime.Date(DateTime.FixedLocalNow(),+10)) – #date(#”Start Year”,1,1)), #duration(1, 0, 1, 0)),
I will let him know your advice.