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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
MorrisBI
Frequent Visitor

Incorrect Grand Total for a DAX measure.

HI everyone!

 

I have a DAX measure that does not sum the entire column, just the second subtotal, here is the image of the code and the example of the column with the error:

 

Gastos totales = 
    sumx (
        values('Calendario2'[Mes]),
        sum(GastosFijos[Gasto]
 ))
 
MorrisBI_0-1662766617561.png

 

 

I looked for this issue and solve some of the errors with the combination of SUMX and values, but for a strange reason the Grand Total keeps showing wrong, sometimes I see that is the total of the dataset but here is not the case, I'm not applying any filter at all neither.

 

Thanks!

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @MorrisBI 

Please try

Gastos totales =
SUMX (
    SUMMARIZE (
        'Calendario2',
        'Calendario2'[Año],
        'Calendario2'[Trimestre],
        'Calendario2'[Mes]
    ),
    CALCULATE ( SUM ( GastosFijos[Gasto] ) )
)

View solution in original post

7 REPLIES 7
tamerj1
Super User
Super User

Hi @MorrisBI 

Please try

Gastos totales =
SUMX (
    SUMMARIZE (
        'Calendario2',
        'Calendario2'[Año],
        'Calendario2'[Trimestre],
        'Calendario2'[Mes]
    ),
    CALCULATE ( SUM ( GastosFijos[Gasto] ) )
)

Hi

 

This work.

 

But, please, can you tell my why is summarize the best options instead of value? I simple don't understood as I should.

 

@MorrisBI 

To create a virtual table that simulates the matrix visual and then iterate over it. This will guarantee we are summing the visible values in the matrix.  

amitchandak
Super User
Super User

@MorrisBI , Refer to suggestion from @Chew_WenJie . But I think you need to use calculate in expression as you have used aggregation

 

Gastos totales =
sumx (
values('Calendario2'[Mes]),
calculate(sum(GastosFijos[Gasto])
))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi

 

I did it but doesn't work, the outcome is the same with the error on Grand Total.

 

I suspect, my mistake is in the second line but not sure how to fix it.

Chew_WenJie
Resolver III
Resolver III

Hihi, maybe you can try to change the column of the values 

values('Calendario2'[Mes]),

to other columns to get the correct subtotals.

 

Hope this can help you.

Hi

 

Changing from Mes (Month) to another one, let say Dia (Day) just will end up giving me another numbers with the same error in the Grand Total.

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.