Forum Discussion
PREVIOUSDAY isn't working... help?
Hi ChrisHaas, thanks for your reply.
I do have a calendar table. There is a relationship between my ship date and my calendar table.
I checked the raw data and there are definitely orders from yesterday.
Also, I created another formula:
Yesterday = RELATED('ordertable'[Yesterday Sales])*'itemtable'[SKU Qty]
In the order table I set up a reference column that gives a 1 or a 0 if the date is yesterday. Then I just ask the formula to multiply that by the number of items sold. So 1 * items sold or 0 * items sold. I know there are other ways, but I wanted a very direct / basic visual of what was working or not. In this case I get data from yesterday.
I also feel like if it was a problem with my calendar table the MTD and YTD functions wouldn't work properly.
As I tested, when we directly import a date column into table visual, and include a calculated measure with PREVIOUSDAY() function, I reproduced same issue as yours. The measure return all BLANK().
However, I find if we build a date hierarchy with the date column and import the data field under hierarchy, the measure works properly.
I would recommend you sumbit this issue as potential bug on Idea: https://ideas.powerbi.com/forums/265200-power-bi. We will also report this issue internally.