March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Community,
I have loaded a DATEDIM table using query. My table looks like below:
I now want to add the following:
I would need to do this kind of Date Dimension table often so I would like the best method to create this table and use on a regular basis.
I have searched through various posts but I get error message "when i try to add the column with the recommended formula.
Can anyone assist me with this request please?
Here is a link to my test PBI report which should make it alot easier for help.
Thanks Guys
https://www.dropbox.com/s/92fsrl3c65szl9v/TEST%20REPORT.pbix?dl=0
Solved! Go to Solution.
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...
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...
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.
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
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.
Hi Steve, thanks for this link ...I will give it a go.
I previously, did this in excel and then imported into PBI and that worked but i was looking for a quick method.
This looks like the way to go and has a few options I didnt have too...so thanks again for the link.!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
128 | |
90 | |
75 | |
56 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |