Forum Discussion
DATEADD Issue -2 Months
Hi I have a few calculated measures that I am using the DATEADD() function for. I am finding that in a revenue calculation (revenue fact table dated daily) it will not correctly look back -2 from the current month, but it will look back -2 from last month (last full month). Additionally, this same formula will work for a different fact table that is only dated on the first of every month (aka 9/1, 10/1, 11/1), unlike the revenue fact table. Because of this, I suspect that the formula is not taking a full two months look back considering this current month is not complete. I also believe that this is occuring because the formula below will show data, but only about 50% of what should be there. Any ideas as to how I can clear this filter? I've tried ALL('Calendar'[Date]) filter and a few others similar with no luck..
Try using PARALLELPERIOD('Date'[Date], -2, MONTH) instead of DATEADD
Pat
4 Replies
- Greg_Deckler
Community Champion
Anonymous You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008- AnonymousNot applicable
Hey Greg,
Thanks so much for sending this over. It seems very useful, but to be honest, it is a very complicated solution for what should be a simple problem.
- ppm1
Solution Sage
Try using PARALLELPERIOD('Date'[Date], -2, MONTH) instead of DATEADD
Pat- AnonymousNot applicable
Thanks so much!! It worked perfectly.