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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
In the screenshot below, will the result be the same if we write the filter argument without summarize. Is there any added benefit writing like this
Solved! Go to Solution.
@Cyriackpazhe , The Summarize function is used to create a summary table for the specified columns, but in the case it is not necessary for the filter condition to work correctly,
It can be applied directly also
CALCULATE([SalesAmount], FILTER(Sales, Sales[Color] = "Blue" || Sales[CategoryName] = "Accessories"))
Proud to be a Super User! |
|
It depends how you rewrite the query as to what result you will get. You could use FILTER on the sales table and get the same result, but filtering entire tables as opposed to just the columns you need is not best practice. Here the SUMMARIZE is reducing the number of columns passed to FILTER to just the necessary columns.
You could get the same result with
[Blue or accessories] =
CALCULATE (
[Sales Amount],
KEEPFILTERS ( 'Sales'[Color] = "blue" || 'Sales'[CategoryName] = "accessories" )
)
KEEPFILTERS is required to make sure that the measure doesn't overwrite the filter context coming from the matrix.
It depends how you rewrite the query as to what result you will get. You could use FILTER on the sales table and get the same result, but filtering entire tables as opposed to just the columns you need is not best practice. Here the SUMMARIZE is reducing the number of columns passed to FILTER to just the necessary columns.
You could get the same result with
[Blue or accessories] =
CALCULATE (
[Sales Amount],
KEEPFILTERS ( 'Sales'[Color] = "blue" || 'Sales'[CategoryName] = "accessories" )
)
KEEPFILTERS is required to make sure that the measure doesn't overwrite the filter context coming from the matrix.
@Cyriackpazhe , The Summarize function is used to create a summary table for the specified columns, but in the case it is not necessary for the filter condition to work correctly,
It can be applied directly also
CALCULATE([SalesAmount], FILTER(Sales, Sales[Color] = "Blue" || Sales[CategoryName] = "Accessories"))
Proud to be a Super User! |
|