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
Wilbson313
Regular Visitor

Matrix Subtotal

Hi! I'm from Brazil,

 

The (Simples Nacional) matrix subtotal is not calculating the information by company contained in the rows, it is recalculating the information according to the "accumulated billing" (Rececita Bruta Acumulada 12 meses).

I just need the subtotal to consider the information contained in the lines above, not recalculate.

 

If possible do not show the (Aliquota Efetiva) in Matrix subtotal.

 

Just for curiosity, the calculation used is a way of taxing companies with annual sales of up to R$4,600,000.00

 

Formula of measures:

-----------------------------------------------------------------------------------

Receita Bruta Acumulada 12 meses =
VAR ACUMULADO =
         CALCULATE(SUM('public ger_saida_divisao_produto'[vr_total_produto]),
               DATESINPERIOD('Calendário'[Data],
               LASTDATE(PREVIOUSMONTH('Calendário'[Data])),-13,MONTH))
RETURN
IF(SUM('public ger_saida_divisao_produto'[vr_total_produto])<>BLANK(),
ACUMULADO
)
------------------------------------------------------------------------------------- 
Alíquota =
CALCULATE(
SUM(Planilha1[Alíquota]),
FILTER(Planilha1, [Receita Bruta Acumulada 12 meses] <= Planilha1[Limite Máximo]),
FILTER(Planilha1, [Receita Bruta Acumulada 12 meses] > Planilha1[Limite Mínimo]))
-------------------------------------------------------------------------------------
Valor a Deduzir =
CALCULATE(
SUM(Planilha1[Valor a Deduzir (em R$)]),
FILTER(Planilha1, [Receita Bruta Acumulada 12 meses] <= Planilha1[Limite Máximo]),
FILTER(Planilha1, [Receita Bruta Acumulada 12 meses] > Planilha1[Limite Mínimo]))
 -------------------------------------------------------------------------------------
Alíquota Efetiva =
(([Receita Bruta Acumulada 12 meses] * [Alíquota]) - [Valor a Deduzir]) / [Receita Bruta Acumulada 12 meses]
-------------------------------------------------------------------------------------
Simples Nacional = sum('public ger_saida_divisao_produto'[vr_total_produto]) * [Alíquota Efetiva]

--------------------------------------------------------------------------------------

Simples nacional.png

 

Planiha1:

Wilbson313_0-1629574592152.png

 

 

1 ACCEPTED SOLUTION

I had to create one more measure:

 

Simples Nacional FIX =
SUMX(
         SUMMARIZE('public ger_empresa','public ger_empresa'[razao_social],
             "Empresas", [Simples Nacional]),
[Empresas])
 
ps.: As it is a database, the names of the companies are in another table ( 'public ger_empresa' ).

Simples nacional 2.png

View solution in original post

3 REPLIES 3
Mohammad_Refaei
Solution Specialist
Solution Specialist

Try this:

Simples Nacional =
SUMX (
    'public ger_saida_divisao_produto',
    'public ger_saida_divisao_produto'[vr_total_produto] * [Alíquota Efetiva]
)

 

I had to create one more measure:

 

Simples Nacional FIX =
SUMX(
         SUMMARIZE('public ger_empresa','public ger_empresa'[razao_social],
             "Empresas", [Simples Nacional]),
[Empresas])
 
ps.: As it is a database, the names of the companies are in another table ( 'public ger_empresa' ).

Simples nacional 2.png

Thanks MahammadRafaei

I had tried this, unfortunately didn't work. 

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.