Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Total Sum in matrix

Hi all,

 

I have a matrix where I calculate a value for each cell, and I need the total to be the sum of the values shown on the matrix. 

 

This is the measure that is being used in the matrix: 

Oportunidade = [Delta KPI]*calculate(SUMX('Reajuste coletivo','Reajuste coletivo'[VL_OBRIGACAO_MES_CONTRATO]),'Reajuste coletivo'[DT_REFERENCIA]="2023")*MEDIAN('Reajuste coletivo'[REAJUSTE])*12/100
 
where Delta KPI = 
CALCULATE('Reajuste coletivo'[% isento],'Reajuste coletivo'[DT_REFERENCIA]="2022")-CALCULATE('Reajuste coletivo'[% isento],'Reajuste coletivo'[DT_REFERENCIA]="2023")
 
belaberger2_0-1675953907812.png

 

1 ACCEPTED SOLUTION

@Anonymous 

Sorry I missed to wrap MEDIAN with CALCULATE 

 

Oportunidade =
SUMX (
CROSSJOIN ( VALUES ( 'De para filial'[ESTADO] ), VALUES( 'Reajuste coletivo'[Faixa de vidas]) ),
[Delta KPI]
* CALCULATE (
SUMX ( 'Reajuste coletivo', 'Reajuste coletivo'[VL_OBRIGACAO_MES_CONTRATO] ),
'Reajuste coletivo'[DT_REFERENCIA] = "2023"
)
* CALCULATE ( MEDIAN ( 'Reajuste coletivo'[REAJUSTE] ) ) * 12 / 100
)

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

for some reason its still not summing up to the correct values:

belaberger2_0-1675961718432.png

 

Oportunidade =
SUMX (
CROSSJOIN ( VALUES ( 'De para filial'[ESTADO] ), VALUES ( 'Reajuste coletivo'[Faixa de vidas]) ),
[Delta KPI]
* CALCULATE (
SUMX ( 'Reajuste coletivo', 'Reajuste coletivo'[VL_OBRIGACAO_MES_CONTRATO] ),
'Reajuste coletivo'[DT_REFERENCIA] = "2023"
)
* MEDIAN ( 'Reajuste coletivo'[REAJUSTE] ) * 12 / 100
)

 

@Anonymous 

Sorry I missed to wrap MEDIAN with CALCULATE 

 

Oportunidade =
SUMX (
CROSSJOIN ( VALUES ( 'De para filial'[ESTADO] ), VALUES( 'Reajuste coletivo'[Faixa de vidas]) ),
[Delta KPI]
* CALCULATE (
SUMX ( 'Reajuste coletivo', 'Reajuste coletivo'[VL_OBRIGACAO_MES_CONTRATO] ),
'Reajuste coletivo'[DT_REFERENCIA] = "2023"
)
* CALCULATE ( MEDIAN ( 'Reajuste coletivo'[REAJUSTE] ) ) * 12 / 100
)
Anonymous
Not applicable

Perfect! Thank you so much

tamerj1
Super User
Super User

Hi @Anonymous 

please try

Oportunidade =
SUMX (
SUMMARIZE (
'Reajuste coletivo',
'Reajuste coletivo'[column in rows of the matrix],
'Reajuste coletivo'[column in columns of the matrix]
),
[Delta KPI]
* CALCULATE (
SUMX ( 'Reajuste coletivo', 'Reajuste coletivo'[VL_OBRIGACAO_MES_CONTRATO] ),
'Reajuste coletivo'[DT_REFERENCIA] = "2023"
)
* MEDIAN ( 'Reajuste coletivo'[REAJUSTE] ) * 12 / 100
)

Anonymous
Not applicable

Hi,

 

The column in the rows of the matrix is in another table, so the summarize part is not working.

@Anonymous 

In this case you can use 

CROSSJOIN ( VALUES ( Table1[Column] ), VALUES ( Table2[Column] ) )

Anonymous
Not applicable

for some reason its still not summing up to the correct values:

belaberger2_0-1675962028982.png

 

 

Oportunidade =
SUMX (
CROSSJOIN ( VALUES ( 'De para filial'[ESTADO] ), VALUES ( 'Reajuste coletivo'[Faixa de vidas]) ),
[Delta KPI]
CALCULATE (
SUMX ( 'Reajuste coletivo''Reajuste coletivo'[VL_OBRIGACAO_MES_CONTRATO] ),
'Reajuste coletivo'[DT_REFERENCIA] = "2023"
)
MEDIAN ( 'Reajuste coletivo'[REAJUSTE] ) * 12 / 100
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.