Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Good afternoon guys,
I have an issue doing a measure, as you can see in the right column I have the original sums of the table, but in 2 groups (_1, _6), I have to divide de total in 3, (Original / 3), The measure have a lot of logic inside, but at the end it returns the correct values, the problem is that the grand total of the measured column is not the same as the sum of the column.
The issue is that calculating the Grand Total, it doesnt show as it have to be with the values showed on the matrix,
I tried a lot of ways to do it from this forum but I didn't found any answer that fits well to me,
Regards,.
Solved! Go to Solution.
Hello guys,
I solved the issue doing this new measure, now all works fine,
Saldo Right Amount = IF(HASONEVALUE(DIM_Cross[Group]), [/3], SUMX(VALUES(DIM_Cross[Group]), [/3]))
Also I got the credit from here, maybe it can help you guys in the future,
https://www.youtube.com/watch?v=ufHOOLdi_jk&app=desktop&ab_channel=Curbal
Original = CALCULATE(SUM(DIM_Historic[Earning]) - SUM(DIM_Historic[Debt])) + 0
/3 =
VAR _MinFecha =
SELECTEDVALUE ( DIM_Historic[MonthFechaDiario] )
VAR _MinGrupo =
SELECTEDVALUE ( DIM_Cross[Group] )
VAR _SaldosCalculados =
IF (
_MinFecha IN { 1, 4, 7, 10 }
&& _MinGrupo IN { "_1", "_6" },
[Saldo] / 3,
[Saldo]
)
RETURN
//_SaldosCalculados
IF (
_MinGrupo IN { "_1", "_6" }
&& _MinFecha = 2,
CALCULATE (
SUM ( DIM_Historic[Earning] ) - SUM ( DIM_Historic[Debt] ),
DATEADD ( Fecha[Date], -1, MONTH )
) / 3 + _SaldosCalculados,
IF (
_MinGrupo IN { "_1", "_6" }
&& _MinFecha = 3,
CALCULATE (
SUM ( DIM_Historic[Earning] ) - SUM ( DIM_Historic[Debt] ),
DATEADD ( Fecha[Date], -2, MONTH )
) / 3 + [Saldo],
IF (
_MinGrupo IN { "_1", "_6" }
&& _MinFecha = 5,
CALCULATE (
SUM ( DIM_Historic[Earning] ) - SUM ( DIM_Historic[Debt] ),
DATEADD ( Fecha[Date], -1, MONTH )
) / 3 + _SaldosCalculados,
IF (
_MinGrupo IN { "_1", "_6" }
&& _MinFecha = 6,
CALCULATE (
SUM ( DIM_Historic[Earning] ) - SUM ( DIM_Historic[Debt] ),
DATEADD ( Fecha[Date], -2, MONTH )
) / 3 + [Saldo],
IF (
_MinGrupo IN { "_1", "_6" }
&& _MinFecha = 8,
CALCULATE (
SUM ( DIM_Historic[Earning] ) - SUM ( DIM_Historic[Debt] ),
DATEADD ( Fecha[Date], -1, MONTH )
) / 3 + _SaldosCalculados,
IF (
_MinGrupo IN { "_1", "_6" }
&& _MinFecha = 9,
CALCULATE (
SUM ( DIM_Historic[Earning] ) - SUM ( DIM_Historic[Debt] ),
DATEADD ( Fecha[Date], -2, MONTH )
) / 3 + [Saldo],
IF (
_MinGrupo IN { "_1", "_6" }
&& _MinFecha = 11,
CALCULATE (
SUM ( DIM_Historic[Earning] ) - SUM ( DIM_Historic[Debt] ),
DATEADD ( Fecha[Date], -1, MONTH )
) / 3 + _SaldosCalculados,
IF (
_MinGrupo IN { "_1", "_6" }
&& _MinFecha = 12,
CALCULATE (
SUM ( DIM_Historic[Earning] ) - SUM ( DIM_Historic[Debt] ),
DATEADD ( Fecha[Date], -2, MONTH )
) / 3 + [Saldo],
IF (
_MinGrupo = "1",
[KPI_TotalSells],
IF (
_MinGrupo = "2",
[KPI_TotalProduction],
IF (
_MinGrupo = "3",
[KPI_MargenBruto],
IF (
_MinGrupo = "4",
[KPI_EBITDA],
IF (
_MinGrupo = "5",
[KPI_EBIT],
IF (
_MinGrupo = "6",
[KPI_BeforeTaxes],
IF (
_MinGrupo = "7",
[KPI_FinalBeforeTaxes],
IF (
_MinGrupo = "8",
[KPI_AfterTaxes],
IF ( _MinGrupo = "9", [KPI_Structure], _SaldosCalculados )
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
Hello guys,
I solved the issue doing this new measure, now all works fine,
Saldo Right Amount = IF(HASONEVALUE(DIM_Cross[Group]), [/3], SUMX(VALUES(DIM_Cross[Group]), [/3]))
Also I got the credit from here, maybe it can help you guys in the future,
https://www.youtube.com/watch?v=ufHOOLdi_jk&app=desktop&ab_channel=Curbal
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.