The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a datetime field with contains several blank records.
In Power BI desktop these are shown as blank, and in Power BI service the same. However once the first refresh in Power BI service runs, the blank dates are replaced with '30/12/1899'.
Apart from how annoying that is, it also causes a major issue in a date comparison field where I do something like this in dax:
if(isblank(DateX), true, false)
I've tried several solutions already:
All lead to the same outcome; fine in power bi desktop, fine when published, messed up when power bi service refreshes.
Now I know I can probably work around this by adding to the if statement something like DateX = '30/12/1899'.
But I can't imagine that to be the most elegant solution.
Is there any way to find out what I have to change to my column/date settings so power bi service treats 0/null values the same as power bi desktop?
Thanks for your help.
Solved! Go to Solution.
just to be clear, 0 and null are not the same thing. Depending on your timezone the datetime value 0 corresponds to 1899-12-31 or 1899-12-30. That's Microsoft's definition of when the epoch starts.
is it possible that your MySQL source is a bit cavalier in sometimes giving you 0 and sometimes null ?
I ran into something similar, and I would suggest replacing all with nulls in using M Query.
Add steps to replace the BLANKS and " 0 " values....or any value.....
or another more dynmaic way to go about mabe is:
if the %Value_Type% = "Date" then Value,
else if % Some Other Expression % then ........
else NULL
just to be clear, 0 and null are not the same thing. Depending on your timezone the datetime value 0 corresponds to 1899-12-31 or 1899-12-30. That's Microsoft's definition of when the epoch starts.
is it possible that your MySQL source is a bit cavalier in sometimes giving you 0 and sometimes null ?
of course. Therefore I've changed the MySQL view to replace 0 values with null values just to be sure, same result. Still; why do I not see these 1899 dates in power bi desktop: perfectly blank in desktop.