Forum Discussion
Error with PREVIOUSMONTH with calculated column
- 7 years ago
yolanda_meng i got bad news. Now the PREVIOUSMONTH is not supported into Directquery.
take a look in this article, and you will see: "This DAX function is not supported for use in DirectQuery mode. For more information about limitations in DirectQuery models, see http://go.microsoft.com/fwlink/?LinkId=219172."
After your see this article i reccomend you to see the second link, to see all limitations with DAX. It has been changed probally in this last update.
don't forget to mark this post as solution, other people can have the same situation in the future.
yolanda_meng hello, make sure that all date columns are okay, sometimes one row could have null values and it are 'crashing' your measure.
If all are fine let me know!
- yolanda_meng7 years ago
Advocate I
Hi henriquesilveir,
Thank you for your reply! Yes, we have noticed before that in Power BI desktop, if the date column is blank, the measure will break. However, this time we don't see the error in Power BI desktop as the date column is good, but then only break on app.powerbi.com. Any thoughts?
- henriquesilveir7 years ago
Resolver IV
yolanda_meng hello , man use this solution to your:
https://community.powerbi.com/t5/Desktop/direct-query-previous-month/td-p/205439
May is necessary to create a dim calendar to your table, it can be the problem!
let me know if you got a solution , don't forget to mark this post as solution if you got it, other person may can have the same situation in the future!
- yolanda_meng7 years ago
Advocate I
Hi henriquesilveir,
This is the Month column we are using:
Month = DATE(YEAR('Table1'[CreatedDate]),MONTH('Table1'[CreatedDate]),1)
It's actually very similar to the post you mentioned. With this in the PREVIOUSMONTH measure, it was working fine until yesterday but not right now. Really not sure what's happened..