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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Benato
Frequent Visitor

Problem with table totals

Hi there,

 

I am struggling with a problem related to the total and subtotal values in a table visual. Although my total number is correct, the subtotal values in each row are incorrect, and the subtotals of each row do not add up to my total, as can be seen in the figure below.

 

Benato_1-1678115315227.png

 

 

For my measure a use the follow DAX formula: 

TesteKPI_AderenciaPeriodicasAcu_1 =

Var StDate = MIN('Calendar'[Date])
Var EndDate = MAX('Calendar'[Date])+1

Var PrevExec =
calculate(DISTINCTCOUNT(Ordens_SPCM[OS]),Ordens_SPCM[DescSimpOS]="PREVENTIVA",Ordens_SPCM[DataConsi]>=StDate,Ordens_SPCM[DataConsi]<=EndDate,Ordens_SPCM[StatusUser]<>"15NE",Ordens_SPCM[Nivel2StSist]= "ENTE CONF",Ordens_SPCM[dtFimReal]>=StDate,Ordens_SPCM[dtFimReal]<EndDate)

Return
CALCULATE(PrevExec)

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

During my previous analyses, I found that removing the following from the formula: "Ordens_SPCM[dtFimReal]<EndDate" helped the subtotal and total values work correctly. However, when I added it back, my numbers did not add up to the total.

Do you have any tips for how to handle this problem?

2 REPLIES 2
Anonymous
Not applicable

Hi @Benato ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

In addition, you can also take a look at the following blog about measure calculated with multiple aggregations if helps:

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

Hi,

 

I uploaded the pbix file in the follow link: KPI_Man.pbix

 

Regards,

Benato

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors