Forum Discussion
Laocsulak
Helper I
3 years agoGet last months from a table
I have a table like this: I need to get a table with just the last month information. So in this example, it would be dates just since 26/11/2022. I have tried Date_Goal = CALCULATET...
FreemanZ
Super User
3 years agohi Laocsulak
try to write the table like this:
Date_Goal =
VAR _maxdate = EDATE( MAX(TableName[Date]), -1) +1
RETURN
CALCULATETABLE(
TableName,
TableName[Date]<=_maxdate
)Laocsulak
Helper I
3 years agoThanks! It solved the problem, changing the last inequality, using >= instead of <=.
Date_Goal =
VAR _maxdate = EDATE( MAX('Date'[Date]), -1) +1
RETURN
CALCULATETABLE('Date','Date'[Date]>=_maxdate)