Forum Discussion

Lucy64's avatar
Lucy64
Advocate II
9 years ago

Creating a Date Table

I have connected to data in SQL Server using DirectQuery.  I need to create a date table within Power BI but it appears this is not supported with DirectQuery mode.  Is that correct or am I missing something.  If there is a way, rather than creating it within the database then please let me know.

4 Replies

  • ankitpatira's avatar
    ankitpatira
    Community Champion

    Lucy64 If you're using directquery to sql server and then creating date table via query editor then that will force you to switch your directquery mode to Import as currently you can't have both DQ and Import mode in single pbix file (creating date table via query editor is being treated as import mode). What you can do is out of query editor under Modelling tab -> New Table -> create date table using below code. This will let you have manually created date table without affecting your DQ mode query.

     

    Date = CALENDAR (DATE(2000,1,1), DATE(2016,1,1))

    • BhaveshPatel's avatar
      BhaveshPatel
      Super User

      Thank you ankit. Something new to learn. Just curious to know, Can we use the approach presented by the Ruth in Direct Query Mode.

  • Hi Lucy,

     

    For creating a calender table within powerbi, Please visit this community blog by RuthPozuelo at here.