cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hamlet
Frequent Visitor

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, @Hamlet

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
March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.