Forum Discussion
Filter table by previous date
- 6 years ago
Anonymous
Use a Date calendar
If you have continuous dates
Day behind Sales = CALCULATE(AVERAGE('Runtime Info'[Event Time]),dateadd('Date'[Date],-1,Day))
If the last date is not -1 day, last date with Data
Last Day Non Continous = CALCULATE(AVERAGE('Runtime Info'[Event Time]),filter(all('Date'),'Date'[Date] =MAXX(FILTER(all('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
Anonymous
Use a Date calendar
If you have continuous dates
Day behind Sales = CALCULATE(AVERAGE('Runtime Info'[Event Time]),dateadd('Date'[Date],-1,Day))
If the last date is not -1 day, last date with Data
Last Day Non Continous = CALCULATE(AVERAGE('Runtime Info'[Event Time]),filter(all('Date'),'Date'[Date] =MAXX(FILTER(all('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
Hi amitchandak
**bleep** the second one worked!!! Thank you so much!! If it isn't too much of a trouble, do you have any idea why the one I did, didn't work? The calculated column that created the previous date worked like this:
MAX('Run Info'[Run Date]),
FILTER('Run Info','Run Info'[Run Date]<EARLIER('Run Info'[Run Date]))
)
Thank you either way though. Your solution worked!
- Anonymous5 years agoNot applicable
How you could get the last record of the month until the selected date.
Example:
I have the following table:
Date Amount 05-01-2019 20 23-01-2019 15 15-02-2019 30 12-03-2019 10 24-03-2019 5 04-04-2019 15 13-04-2019 10 28-04-2019 12 and I select in a date filter the date 15-04-2019
Then I wish I could get the following table:
one-19 feb-19 mar-19 Apr-19 Amount 15 30 5 10 As I can do this, since I only manage to get the last data of the month or the last record of the month of the selected date but not both.
I hope you can help me, greetings and thank you in advance