Forum Discussion
Need Help With Time-Series Measures: One and Two Months Prior Sales Based on Selected Value
- 3 years ago
Hi paulsnet1986
You can use these measures :
1. current month margin = sum('Table'[Margin])2.One Month Prior = CALCULATE([current month margin],DATEADD('Table'[Invoice],-1,MONTH))+03. Two Month Prior = CALCULATE([current month margin],DATEADD('Table'[Invoice],-2,MONTH))+0If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- 3 years ago
Hi 1. Try to check your steps near the file I linked in the first reply.
2. If it still not working:
- Create a date table.- Create a relationship between it and your invoices table
- Mark this table as a date table
- Use this table for the formulas modify them to :
current month margin = sum('Table'[Margin])One Month Prior = CALCULATE([current month margin],DATEADD('Dates_table'[Date],-1,MONTH))+0Two Month Prior = CALCULATE([current month margin],DATEADD('Dates_table'[Date],-2,MONTH))+0
Hi paulsnet1986
You can use these measures :
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- paulsnet19863 years ago
Helper I
Hi Ritaf1983
Thanks for your reply! I am getting the following error FUNCTION 'DATEADD" expects contiguous selection when the date column is not unique, has gaps, or contains a time portion.- Ritaf19833 years ago
Super User
Hi 1. Try to check your steps near the file I linked in the first reply.
2. If it still not working:
- Create a date table.- Create a relationship between it and your invoices table
- Mark this table as a date table
- Use this table for the formulas modify them to :
current month margin = sum('Table'[Margin])One Month Prior = CALCULATE([current month margin],DATEADD('Dates_table'[Date],-1,MONTH))+0Two Month Prior = CALCULATE([current month margin],DATEADD('Dates_table'[Date],-2,MONTH))+0- paulsnet19863 years ago
Helper I
That solved it! Ritaf1983 THANK YOU SO MUCH!