Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Lucy64
Advocate II
Advocate II

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 4
v-qiuyu-msft
Community Support
Community Support

Hi @Lucy64,

 

Currently, we are not able to create a calendar table when we connect to SQL Server database in DirectQuery mode, as the "New Table" feature is disabled. In your scenario, you need to create this calendar table on SQL Server database side.

 

Besides, you can vote on this similar idea: Create DAX measures, fields and tables in Direct Query mode.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ankitpatira
Community Champion
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))

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

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
BhaveshPatel
Community Champion
Community Champion

Hi Lucy,

 

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

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors