Forum Discussion

awitt's avatar
awitt
Helper III
4 years ago
Solved

SUMX / Date Range Question

I have a question I am trying to answer with multiple variables that is causing some challenges.    I am wanting to sum the total orders only within a certain time frame for multiple customers. The...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi awitt ,

     

    Create a measure like below.

     

    measure =
    CALCULATE (
    SUM ( 'table1'[sales] ),
    FILTER (
    ALLSELECTED ( 'table1' ),
    'table1'[customer] = SELECTEDVALUE ( 'table2'[customer] )
    && 'table1'[date] >= SELECTEDVALUE ( 'table2'[start] )
    && 'table1'[date] <= SELECTEDVALUE ( 'table2'[end] )
    )
    )

     

    Use 'table2'[customer], table2[start], 'table2'[end] and [measure] to create a visual.

     

    Best Regards,

    Jay