Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Cyriackpazhe
Helper III
Helper III

summarize

Screenshot (3).pngIn 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

 

2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@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"))




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

johnt75
Super User
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.

View solution in original post

2 REPLIES 2
johnt75
Super User
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.

bhanu_gautam
Super User
Super User

@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"))




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.