Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Simple SUM filter problem driving me crazy

Dear power friends,    I have a regular monthly CALENDAR_TABLE with the typical content DATE 01/01/2018 02/01/2018 03/01/2018 (...) linked to a SALES_TABLES by a date column in the same forma...
  • v-chuncz-msft's avatar
    8 years ago

    Anonymous,

     

    You may use Variables in DAX.

    Measure =
    VAR d =
        LASTDATE ( CALENDAR_TABLE[date] )
    RETURN
        CALCULATE (
            SUM ( SALES_TABLE[sales] ),
            FILTER ( SALES_TABLE, SALES_TABLE[date] = d )
        )