Forum Discussion

Laocsulak's avatar
Laocsulak
Icon for Helper I rankHelper I
3 years ago
Solved

Get 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's avatar
    3 years ago

    hi Laocsulak 

    try to write the table like this:

    Date_Goal = 
    VAR _maxdate = EDATE( MAX(TableName[Date]), -1) +1 
    RETURN
    CALCULATETABLE(
        TableName,
        TableName[Date]<=_maxdate
    )