Forum Discussion

Dan_W's avatar
Dan_W
Frequent Visitor
8 years ago
Solved

Sum based on filters

Hi,   I have data comprised of running totals that looks like below and I'm trying to find totals for the asset when filtering for asset and dates.   DATE ASSET QTY 1/1/18 12:00 AM B 1 1/1/18 1:1...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Dan_W,

    Please check if the following DAX returns your expected result. If not, please share source file via OneDrive.

    Grand Total = var MaxValue = MAX(Sheet1[QTY])
    var MinValue = MIN(Sheet1[QTY])
    var Interval Total = MaxValue - MinValue
    
    Return 
    
    SUMX(
                       CALCULATETABLE(
                                      ALLSELECTED(Sheet1[ASSET])),
                                      Interval Total)



    Regards,
    Lydia

  • Dan_W's avatar
    Dan_W
    8 years ago

    Thank you Lydia -your suggestion worked perfectly.