Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Let's assume that I have the Products table in my model defined like this:
| ProductID | UnitPrice | UnitsInStock | Discontinued |
| 1 | 10 | 50 | TRUE |
| 2 | 15 | 30 | FALSE |
| 3 | 20 | 20 | TRUE |
| 4 | 25 | 10 | TRUE |
| 5 | 5 | 15 | FALSE |
I have created two metrics :
Value1 =
CALCULATE ( SUMX ( Products, Products[UnitPrice] * Products[UnitsInStock] ), FILTER ( Products, Products[Discontinued] = TRUE ) )
Value2 =
CALCULATE ( SUMX ( Products, Products[UnitPrice] * Products[UnitsInStock] ), Products[Discontinued] = TRUE )
The only difference is the definition of the filter. I have evaluated the results in Power Desktop but I do not see any difference. This leads to my question: How could this definition affect the final result of the metric or when might this occur?
Solved! Go to Solution.
The two measures are essentially identical, both are calculating the result for products which are discontinued.
The definition for value2 is rewritten internally to be
Value2 =
CALCULATE (
SUMX ( Products, Products[UnitPrice] * Products[UnitsInStock] ),
FILTER ( ALL ( Products[Discontinued] ), Products[Discontinued] = TRUE )
)
The form of CALCULATE where you can specify a predicate as a filter rather than a table is merely syntax sugar, to make the code easier to read and write.
The two measures are essentially identical, both are calculating the result for products which are discontinued.
The definition for value2 is rewritten internally to be
Value2 =
CALCULATE (
SUMX ( Products, Products[UnitPrice] * Products[UnitsInStock] ),
FILTER ( ALL ( Products[Discontinued] ), Products[Discontinued] = TRUE )
)
The form of CALCULATE where you can specify a predicate as a filter rather than a table is merely syntax sugar, to make the code easier to read and write.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 18 | |
| 14 | |
| 14 |