2
votes

I have the following matrix (example):

enter image description here

The matrix SUM all rows, but I need a way to say what "Description" I want to SUM, like de following matrix (example):

enter image description here

I have the following fields on matrix:

Lines:

  • Field 1: Type

  • Field 2: Description

Columns:

  • Field 1: Month/Year

Values:

  • Field 1: Measure: CALCULATE(SUM(Table[Values]); Table[LastOfMonth] = "True")

And for help, I have a column indicator on table (Table[NeedSum] = "True") saying if that row should SUM on matrix or not.

1

1 Answers

3
votes

Try something like this:

Maesure :=
IF (
    HASONEFILTER ( 'Table'[Description] ) = TRUE ();
    CALCULATE ( SUM ( 'Table'[Values] ); 'Table'[LastOfMonth] = "True" );
    CALCULATE ( SUM ( 'Table'[Values] ); 'Table'[LastOfMonth] = "True";
         'Table'[NeedSum] = "true"
    )
)