Forum Discussion

railtons's avatar
railtons
Helper I
2 years ago
Solved

Customize the matrix component totals.

I'm working with the matrix component to represent my project tracking information.
At the bottom of the component, I enabled the option to show the totals. However, this total is the sum of the first level items, i.e. in the total I can't see the total of the children.
Is there any way to customize it so that the total at the bottom can also total the items inside?
Or is there any way I can do something similar?

Thank you very much.

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi railtons ,

    You cannot have the Total in the matrix calculate the sum of different types separately and present it in a hierarchy. There is no setting that can achieve this effect.
    And according to your screenshot, there should be fields placed in the rows, columns, and values ​​of your matrix, which means that you cannot add additional measures or columns to the existing matrix to achieve your effect unless you rebuild the entire matrix.
    I suggest you create an additional matrix to show the two sums.
    Here is my sample data:

    Use this DAX to create a measure:

    Total = 
    VAR _Type1 = MAX('Table'[Type1])
    VAR _Type2 = MAX('Table'[Type2])
    RETURN
    CALCULATE(
        SUM('Table'[Value]),
        ALLEXCEPT('Table', 'Table'[Group]),
        'Table'[Type1] = _Type1 && 'Table'[Type2] = _Type2
    )

    Then create the matrix:

     

    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    In your matrix visual options, look for the row/column subtotals options.  If thats not turned on, try turning it on.

     

    If you have multiple levels, you can also turn on/off lower order totals individually with the "Per Row/Column Level" option.

  • Thanks a lot for you feedback.
    Look the option that is on in my case:


    I need to have a "+" before the total line to see the total by group.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi railtons ,

      You cannot have the Total in the matrix calculate the sum of different types separately and present it in a hierarchy. There is no setting that can achieve this effect.
      And according to your screenshot, there should be fields placed in the rows, columns, and values ​​of your matrix, which means that you cannot add additional measures or columns to the existing matrix to achieve your effect unless you rebuild the entire matrix.
      I suggest you create an additional matrix to show the two sums.
      Here is my sample data:

      Use this DAX to create a measure:

      Total = 
      VAR _Type1 = MAX('Table'[Type1])
      VAR _Type2 = MAX('Table'[Type2])
      RETURN
      CALCULATE(
          SUM('Table'[Value]),
          ALLEXCEPT('Table', 'Table'[Group]),
          'Table'[Type1] = _Type1 && 'Table'[Type2] = _Type2
      )

      Then create the matrix:

       

      Best Regards,
      Dino Tao
      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.