locked
Calculate sum of measure for multiple date range in DAX RRS feed

  • General discussion

  • Hello,

    Is there a way to calculate the sum of measures for multiple date ranges in DAX ?

    For e.g. There are are 2 date range 20060101 to 20060312 and 20070101 to 20070520. I need to get the SUM of measure (INVOICE) for the 2 periods.

    Output should be:

    Time         Invoice
    Period 1     250
    Period 2     400

    I was able to calculate the measure for only one date range using the below DAX

    EVALUATE SUMMARIZE(CALCULATETABLE('Sales_Transactions',
    DATESBETWEEN('Time'[Day_DATE], DATE(2006, 01, 01), DATE(2006, 03, 12))),
    "Time", "period 1", "INVOICE", 'Sales_Transactions'[INVOICE])

    If it is not possible to get the measures for multiple date range in a single DAX? Or else is it possible to UNION multiple DAX (each with single date range) and combine all the results?

    Thanks

    Wednesday, May 29, 2013 8:45 PM

All replies