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
Anonymous
Not applicable

DAX Date in Direct Query mode

Hi everyone

First of all, thanks for you work guys.
Second, I used this function[1] without problems until it stopped working last week, I am in Direct Query mode. When writing it to DAX, the following message appears: "Not a legal OleAut date. The exception was raised by the IDataReader interface."

Version: 2.65.5313.701 64-bit (2018 December)
Anybody can help me?

[1]

FechasDax = 
VAR BaseCalendar = 
    CALENDARAUTO()
RETURN
    GENERATE(
        BaseCalendar,
        VAR BaseDate = [Date]
        VAR YearDate = Year(BaseDate)
        VAR MonthNumber = Month(BaseDate)
        RETURN ROW(
            "Day", BaseDate, 
            "Year", YearDate,
            "Month Number", MonthNumber,
            "Month", FORMAT(BaseDate,"mmmm"),
            "Month Year", FORMAT(BaseDate,"mmm yy")
        )
    )

 

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

I have tested it by your formula on my side, but not reproduce the issue.

So please

1. try to update power bi desktop to the latest version.

2. check the actual date values in your table, You most probably have some date with the wrong, look all your date values, try sorting and checking de min and max value of each field.

 

Best Regards,

Lin

 

 

Community Support Team _ Lin
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.