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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
pstanek
Post Patron
Post Patron

Direct Query Year , month

Hi , I created  two calculated  columns in DAX  by functions Year , Month from date( It is direct query mode!!!!!).  But Table  where it was calculated is now too large. 

Is there equivalent to calculate year, month, from date in Query editor in Direct query mode? An is it faster?

 

Do you have another idea how to make it faster? Maybe create table calendar in database.

 

 

I use thse columns as filter nad that is the problem, You can see empty square and that is exactly filter with calculated column year.

 

 

Capture.PNG

 

 

 

 

 

 

 

 

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @pstanek,

 

Assume you connect to SQL Server database, you can get Year and Month columns use T-SQL Query like below:

 

q1.PNG

 

 

Also you can use the Date.Year() and Date.Month() function to create columns in Query Editor.

 

q2.PNG

 

 

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.

Thanks for idea, we are going to fix by spark connection.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.