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 , 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!
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..
- henriquesilveir7 years agoResolver IV
yolanda_meng it's strange, please send me your .PBIX file with a little sample of data, and i will see for you, okay?
- yolanda_meng7 years agoAdvocate I
henriquesilveirThanks for your help!
But we are using DirectQuery so you might not able to open the pbix file we are using. I was able to reproduce the same error with a basic query - just select a date column from GETDATE() and use DAX to populate the Month column and use it with the PREVIOUSMONTH function will break the chart.
- henriquesilveir7 years agoResolver IV
yolanda_meng try to create a Dim Calendar... perhaps some of your date can crash your model... make sure that you using a Dim Calendar to do this... it's recommend for PBI temporal measures. let me know if you got solution with a Dim Calendar.