The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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]
))
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!
Solved! Go to Solution.
Hi @MorrisBI
Please try
Gastos totales =
SUMX (
SUMMARIZE (
'Calendario2',
'Calendario2'[Año],
'Calendario2'[Trimestre],
'Calendario2'[Mes]
),
CALCULATE ( SUM ( GastosFijos[Gasto] ) )
)
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.
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.
@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])
))
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.
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.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
21 | |
20 | |
12 | |
11 | |
7 |