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
Solved! Go to Solution.
hi,
the syntax:
CALCULATE ( <Expression> [, <Filter> [, <Filter> [, … ] ] ] )
treat Filter1, Filter2 with the AND operations.
to use the OR operations, you need to use it within the same filter.
testcalculate =
VAR ano =
FORMAT ( YEAR ( MAX ( FatoOpex[Data] ) ) - 3; "####" )
RETURN
CALCULATE (
SUM ( FatoOpex[valor] );
FILTER(FatoOpex;
OR (
FatoOpex[exDiretoria] = "0"
&& FatoOpex[DimCalendario.Ano] = ano;
FatoOpex[exDiretoria] = "1"
&& FatoOpex[DimNatureza.idNatureza] = "7"
&& FatoOpex[DimCalendario.Ano] = ano
)
)
Give this a try
testcalculate =
VAR ano =
FORMAT ( YEAR ( MAX ( FatoOpex[Data] ) ) - 3; "####" )
RETURN
CALCULATE (
SUM ( FatoOpex[valor] );
OR (
FatoOpex[exDiretoria] = "0"
&& FatoOpex[DimCalendario.Ano] = ano;
FatoOpex[exDiretoria] = "1"
&& FatoOpex[DimNatureza.idNatureza] = "7"
&& FatoOpex[DimCalendario.Ano] = ano
)
)
thank you for your try, but have this :
"The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression."
hi,
the syntax:
CALCULATE ( <Expression> [, <Filter> [, <Filter> [, … ] ] ] )
treat Filter1, Filter2 with the AND operations.
to use the OR operations, you need to use it within the same filter.
testcalculate =
VAR ano =
FORMAT ( YEAR ( MAX ( FatoOpex[Data] ) ) - 3; "####" )
RETURN
CALCULATE (
SUM ( FatoOpex[valor] );
FILTER(FatoOpex;
OR (
FatoOpex[exDiretoria] = "0"
&& FatoOpex[DimCalendario.Ano] = ano;
FatoOpex[exDiretoria] = "1"
&& FatoOpex[DimNatureza.idNatureza] = "7"
&& FatoOpex[DimCalendario.Ano] = ano
)
)
thank you ! it worked fine!
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.