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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.