Forum Discussion
Dateadd issue with quarter
Hello,
I encountered problem with dateadd function when trying to calculate values from previous quarter. Same problem as in post below:
DateAdd problem with Quarter - Microsoft Power BI Community
This is how my data looks:
Does anyone know why it shows blank only in case of 30/6?
Hi, Vladan
This problem may be due to the fact that DATEADD does not correctly identify the end of the month, and on June 30 he wants to return March 30, but there is no such date in the table.
You can try the function EDATE. https://docs.microsoft.com/dax/edate-function-dax
At this time, two dates appear, March 30 and March 31. In order to display the dates of the previous quarter, you can try to specify the data range in the form of Year-month.
Measure = CALCULATE('Table'[Assets 1],FILTER(ALL('Table'),[Year Month]=SELECTEDVALUE('Table'[Last Quarter])))Is this the output you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- v-zhangti
Community Support
Hi, Vladan
This problem may be due to the fact that DATEADD does not correctly identify the end of the month, and on June 30 he wants to return March 30, but there is no such date in the table.
You can try the function EDATE. https://docs.microsoft.com/dax/edate-function-dax
At this time, two dates appear, March 30 and March 31. In order to display the dates of the previous quarter, you can try to specify the data range in the form of Year-month.
Measure = CALCULATE('Table'[Assets 1],FILTER(ALL('Table'),[Year Month]=SELECTEDVALUE('Table'[Last Quarter])))Is this the output you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- amitchandak
Super User
Vladan , Dateadd needs continuous dates , Please use a date table and try
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos. - AllisonKennedy
Community Champion
Vladan the DATEADD Function should only be used with a Date dimension table - do you have a dimDate table you can use in the formula instead of the DAtaMerged[Date] ?
- VladanRegular Visitor
I have a calendar table that is connected to my maiin table. I changed the measure but no luck in desired outcome.
This is how it all looks now: