Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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?
Solved! Go to Solution.
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.
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.
@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] ?
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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:
@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-bd52912a5b...
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.
User | Count |
---|---|
96 | |
87 | |
78 | |
72 | |
69 |
User | Count |
---|---|
113 | |
105 | |
84 | |
65 | |
64 |