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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
fabiocesarei
Advocate I
Advocate I

2 filter on summarize table

Hi ,
I want to create a table by summerize function, but I need to insert two filter conditions
(I need to filter the data by year and by an " X " field of the data set), is it possible?

2 REPLIES 2
AlexChen
Employee
Employee

Hi,

 

I advise you to use “SummarizeColumns” function to do it.

 

Now I assume you have a table called “prod” like below.

 

1.png

 

You can create a table use the following code.

The products that are created before 2010 and amount value that are less that 2000 are filtered.

 

Table = SUMMARIZECOLUMNS(

                                      prod[product],

                                      filter(prod, year(prod[createdDate]) > 2010 && prod[amount] >= 2000),

                                      "amt", sum(prod[amount])

                                      )

 

2.png

 

Best Regards

Alex

 

 

Hi Alex, thank for reply. Filter is supported in summarize, I have used this example SUMMARIZE(FILTER('Time';'Time'[year]=2015);'Time'[quarter]; "CostQtr";SUM('Fact_costs'[.......
and it worked.
perhaps power bi converts the function.
I have to use 2 fields of different tables in filter function, do I have to create a previous table with a filter option and the second field as column and use it as filter in the final one?

Thanks

Fabio

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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