Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Adding year to the formula calculation

Hi,    I have a formula which is mentioned below:   Total Number of Class A = CALCULATE(COUNTROWS('SHOP Final Assy-Casework'), FILTER(ALL('SHOP Final Assy-Casework'), 'SHOP Final Assy-Casework'[C...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Anonymous,

     

    How about below formula, you can try it if it works for your scenario:

    Total Number of Class A =
    CALCULATE (
        COUNTROWS ( 'SHOP Final Assy-Casework' ),
        FILTER (
            ALLSELECTED ( 'SHOP Final Assy-Casework' ),
            'SHOP Final Assy-Casework'[Class Level] = "Class A"
        ),
        VALUES ( 'SHOP Final Assy-Casework'[Year] ),
        VALUES ( 'SHOP Final Assy-Casework'[Month] )
    )
    

    If not help, please share some sample data for test and coding formula.

     

    Regards,

    Xiaoxin Sheng

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Anonymous,

     

    If you mean you wanted to calculate cumulative total, you can take a look at following blog:

    Cumulative Total

     

    In addition, you can remove 'class level' filter condition to get total count of specific records:

    Total Number of Class A =
    CALCULATE (
        COUNTROWS ( 'SHOP Final Assy-Casework' ),
            ALLSELECTED ( 'SHOP Final Assy-Casework' ),
        VALUES ( 'SHOP Final Assy-Casework'[Year] ),
        VALUES ( 'SHOP Final Assy-Casework'[Month] )
    )

     

    Regards,

    Xiaoxin Sheng