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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Date Management with DirectQuery connection

Hi all,

 

I am applying a DirectQuery connection to a big table which includes a date field (ACTUAL_DATE). Of course, since this is a DirectQuery connection, I cannot transform this field into a date type, which I find a big limitation in the analysis.

 

The temporary solution that I've applied is adding an Excel file to the model (Import mode). This file has only one column (NEW_DATE) with all the dates in the same format as the original table, thus I'm able to (1) link it to the orignal table and (2) use this new field as a date type field with all its functionalities. This seems to work just fine.

 

My question is, is there any alternative to this workaround, avoiding the need to load an additional manual Excel File?

 

Thank you in advance for your replies.

5 REPLIES 5
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can create a calculated table to work around like that.

Table = CALENDAR(MIN('Product'[SalesDate]),MAX('Product'[SalesDate]))

2.PNG

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi again,

 

Any ideas? I'm still lost with this one.

 

Thanks!

Anonymous
Not applicable

Thank you for your reply. Unfortunately this approach is not working, since Power BI is not able to properly calculate the minimum amb maximum values for the field. For further reference, the following KPIs throw the following results:

 

MinDate = min(DFU_TEST_2[STRT_DT]) => Result when printed as a card: 01/04/2019
MaxDate = max(DFU_TEST_2[STRT_DT]) => Result when printed as a card: 31/12/2018
 
Therefore when I try your approach I get an error indicating that the minimum date cannot be greater than the maximum one.
 
Any clues on how to fix this?
Greg_Deckler
Community Champion
Community Champion

I would think that the ACTUAL_DATE field should get recognized as a date field in Power BI


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

It can't, as you can see in the following screenshot:

 

(For some reason I cannot add the image, you can find it here: i.ibb.co/C1JWR6h/error.png

 

Sorry it's in Spanish. Essentially it is saying that "this step leads to a query that is not compatible with DirectQuery mode" and suggests me to switch to Import, which I don't want.

 

 

Helpful resources

Announcements
December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.