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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Rosenmeyer
Frequent Visitor

Custom Date column won't connect to Date Table

I have 2 identical SQL queries that are respectively imported query and one direct query from an Azure SQL database.

 

I need to make the imported query in direct query so I can make a scheduled refresh.

 

I have a date in the imported sales table [ClosedAt] that is Date/Time, I extract the date in a custom column [ClosedAtDate], because my Date/Time column [ClosedAt] won't connect unless it's only the date=

ClosedAtDay = DATE(YEAR('Sales import'[ClosedAt]);MONTH('Sales import'[ClosedAt]);DAY('Sales import'[ClosedAt]))
I make a connection to the date table with !imported SQL query! 'imported Sales'[ClosedAtDay] to 'DateTable'[Date] in the relationship model and it works with date filters and slicers.
 
I do the exact same for the !direct query table! and this error happens when I try to date filter anything by date slicer:
image.png
 
Both queries are identical.
5 REPLIES 5
parry2k
Super User
Super User

@Rosenmeyer why not change the data type of that column to date



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k If I change the column to Date it just makes everything go (Blank) when I try to filter by date slicers.

Hi @Rosenmeyer ,

 

Have you issue be resolved?Could you please provide more details about it If it still not be soleved? Please don't have any Confidential Information or Real data in your reply.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-lid-msft 

 

I used this formula

 

Dato = CALENDAR(DATE(2018;7;1);Format(MAXX(VALUES(Sales[ClosedAt]);Sales[ClosedAt]); "dd-mmmm-yy"))
 
That I found in another thread. I also deleted the custom SQL query and selected the table through Power Query instead, somehow worked, don't know what the issue was.

Hi @Rosenmeyer ,

 

I do the exact same for the !direct query table! 

Could you please share the formula that you create the column "CloseAtDate" for Directquery table? Are you creating it in the Power Query Editor?


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.