Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
How can i get the sale for the day one week back,month back and year back for a particular column?
Not sum till date, just the sale on that particular day, week back,one month back and year back.
For eg, if today is 28/07/2022, i want my sale on 21/06/2022,28/06/2022 and 27/07/2021.
Thanks In Advance.
Data set view and expected results images attached.
Many Thanks.
Solved! Go to Solution.
You can use DATEADD, e.g.
Prev Month = CALCULATE( [Base measure], DATEADD('Date'[Date], -1, MONTH)
Prev Year = CALCULATE( [Base measure], DATEADD('Date'[Date], -1, YEAR)
Prev Week = CALCULATE( [Base measure], DATEADD('Date'[Date], -7, DAY )
You can use DATEADD, e.g.
Prev Month = CALCULATE( [Base measure], DATEADD('Date'[Date], -1, MONTH)
Prev Year = CALCULATE( [Base measure], DATEADD('Date'[Date], -1, YEAR)
Prev Week = CALCULATE( [Base measure], DATEADD('Date'[Date], -7, DAY )