Help on Using Date Functions within DAX Measures RRS feed

  • Question

  • I am trying to get the max date from a lookup table and pass it into a DAX measure. It throws the following error:

    A function 'MAX' has been used in a Boolean expression that is used as a table filter expression. This is not allowed.

    Here is the measure I am trying to create. How can I do this in DAX without hard coding in the date?

    =SUMX(FILTER(Raw_Data, Raw_Data[Filter_Date]>=DATEADD(MAX(Act_Rel_Date_Lookup[ACT_REL_DATE]),-12,MONTH))

    • Edited by Whalensdad Wednesday, January 18, 2012 10:51 PM
    Wednesday, January 18, 2012 10:51 PM


  • Hi Whalensdad

    You can use a function like LASTDATE.   For example, the query below gets the last date which has related 'Reseller Sales Amount' data available.

    CALCULATE( LASTDATE( DimDate[FullDateAlternateKey] ), FILTER( FactResellerSales, FactResellerSales[SalesAmount] > 0 ) )


    Javier Guillen
    • Marked as answer by Challen Fu Wednesday, February 8, 2012 7:40 AM
    Monday, February 6, 2012 9:36 PM