Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Running Total / Cumulative Total

Hi

Our below DAX is not working, Please check and let us know what could be done:

Data is showing correctly is we are checking it by the contact date, However, when we are trying to show the data month wise we are getting incorrect values.

=

CALCULATE('DW F_Drv_WQ_ValidatedOpsContacts'[IsContact_count],

FILTER(ALL('DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate]),

'DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate] <= MAX('DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate])))

ContactDate Wise:

 

Month Wise:

 

 

  • Hi Anonymous ,

     

    As NickolajJessen  says, you need to clear the filters for the entire table, not just column [ContactDate].

     

    Measure = 
    CALCULATE (
        'DW F_Drv_WQ_ValidatedOpsContacts'[IsContact_count],
        FILTER (
            ALL ( 'DW F_Drv_WQ_ValidatedOpsContacts' ),
            'DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate]
                <= MAX ( 'DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate] )
        )
    )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • CALCULATE('DW F_Drv_WQ_ValidatedOpsContacts'[IsContact_count],

    FILTER(ALL('DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate]),

    'DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate] <= MAX('DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate])))

    You're specifying, that only the Contract date should be considered in the ALL function, which is why it works when the contract date is filtering the vilsual, but not the month_short_duplicate field

  • Anonymous , is [IsContact_count] is measure ? if yes share calculation

     

    Also month yesr column should come from F_Drv_WQ_ValidatedOpsContacts

     

    best to use date table

     

    Try like

    CALCULATE(Sumx(values('DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate]) , 'DW F_Drv_WQ_ValidatedOpsContacts'[IsContact_count]) ,

    FILTER(ALL('DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate]),

    'DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate] <= MAX('DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate])))

     

    or

     

    CALCULATE([IsContact_count] ,

    FILTER(ALL('DW F_Drv_WQ_ValidatedOpsContacts),

    'DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate] <= MAX('DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate])))

    • v-kkf-msft's avatar
      v-kkf-msft
      Community Support

      Hi Anonymous ,

       

      As NickolajJessen  says, you need to clear the filters for the entire table, not just column [ContactDate].

       

      Measure = 
      CALCULATE (
          'DW F_Drv_WQ_ValidatedOpsContacts'[IsContact_count],
          FILTER (
              ALL ( 'DW F_Drv_WQ_ValidatedOpsContacts' ),
              'DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate]
                  <= MAX ( 'DW F_Drv_WQ_ValidatedOpsContacts'[ContactDate] )
          )
      )

       

      If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
      Best Regards,
      Winniz
      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.