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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Bug: DirectQuery to Postgres database does not support DAX function WEEKDAY() with ReturnType <> 1

Complete bug report is in the title I think.

I created a connection to a Postgres table in my PBI report using DirectQuery. In DAX, I added a new computed column using the formula:

weekday = WEEKDAY([timestamp], 2)

Which gives me an "OLE DB or OBDC Error" when using the column in a visual.

However, if I change the formula to

weekday = WEEKDAY([timestamp])


weekday = WEEKDAY([timestamp], 1)

, the column works without any problems.

If I use Import mode instead of DirectQuery, the original formula works, too.


The workaround is obvious, but this should not happen. Hm ...

Status: New
Frequent Visitor

Also, WEEKDAY(_)/WEEKDAY(_, 1) confuse with returning values in the interval [0, 6] whereas the docs state it should be [1, 7].

Community Support



That seems to work fine for me. To help improve MSDN documentation, share feedback on GitHub.

Frequent Visitor

@v-chuncz-msft Could the problem be specific to a system with a German localization (DE-de)?