+ Reply to Thread
Results 1 to 6 of 6

Problems creating Calendar in Data Model

  1. #1
    Registered User
    Join Date
    10-18-2019
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 365
    Posts
    7

    Problems creating Calendar in Data Model

    Dear all,

    Just now I've started in Power Query/Pivot, and using the Data Model. It's a great tool, and mostly I'm learning and applying a lot.

    However, I've been running into an issue where the automatic Calendar function in the Data Model keeps relating to wrong dates, i.e.; my data starts at 1-1-2018, but the Calendar starts all the way back in 1-1-0209, listing all days to 2020.

    I've tried messing around with data types in Power Query, Locale Date notations, Cultures, etc. But nothing helped to prevent this from happening. In a clean sheet with only a Query with dates, it does work.

    Now I removed all tables from the Data Model, and only included the extracted Query dates, and it loads perfectly, after which I loaded all the other tables succesfully as well.

    Now my question is, why? Does it matter what tables I've loaded into the Data Model in what order, since there's no way to 'select' the source for the Calendar. Is this a simple lesson for future reference to first load the data table for the Calendar, and then add all other tables?

    I hope to get this cleared up.
    Last edited by FlowSnake; 10-18-2019 at 06:29 AM.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Problems creating Calendar in Data Model

    Auto calendar will base the date range on all Date type values in your data model. If the auto calendar is creating rows outside your expected range, it would indicate that there are date values outside your expected range in a date column somewhere...
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    10-18-2019
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Problems creating Calendar in Data Model

    Hi Olly,

    Thanks for your quick reply.

    That might explain the issues I've been running into since I loaded a table containing information about our entire product range, which includes fields when the article has been introduced, when to start/stop purchasing, and start/stop selling.

    So I suppose my fix for now works, untill the entire data model is refreshed. I will delete these columns from my data set in Power Query instead since they're of no use anyway.

    Thanks again!

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Problems creating Calendar in Data Model

    You don't have to use the auto Calendar, you could create your own Calendar table, with manual control of the date range. Here's an example, using Power Query:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-18-2019
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Problems creating Calendar in Data Model

    Ho, that's a nice one. I will try that one as well, thanks. Will I have to use the 'mark as date table' in power pivot using that query?

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Problems creating Calendar in Data Model

    Yes, mark as date table so that you can use all the time intelligence functions.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating a Pivot Table from Power Pivot Data Model?
    By nobodyukno in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2017, 12:02 PM
  2. Problems creating a dropdown box (data validation)...
    By BadBoy House in forum Excel General
    Replies: 7
    Last Post: 07-05-2012, 01:48 PM
  3. Excel 2007 : Creating a Calendar from Excel Data
    By Bernardk in forum Excel General
    Replies: 0
    Last Post: 09-06-2011, 08:03 PM
  4. Problems Creating an Annual Leave Calendar
    By SimonGreenwich in forum Excel General
    Replies: 0
    Last Post: 08-03-2011, 09:08 AM
  5. data validation-creating a costing model
    By molly147 in forum Excel General
    Replies: 2
    Last Post: 09-14-2008, 06:14 PM
  6. creating a search model
    By ajaffer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2005, 05:45 PM
  7. I am having problems creating pivot table of data
    By wyman in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-12-2005, 02:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1