Forum Discussion

summer18's avatar
summer18
Icon for Helper III rankHelper III
4 years ago
Solved

summarize table with filters

Hi,

 

I'm trying to create a summarized table with multiple filters and sum of measures but I'm getting different error.  I tried to combine CALCULATETABLE, SUMMARIZE and filter functions but could not seem to work.  My formula here is without FILTER function.  Can you please help me what should be the correct formula?  

 

Summary =
CALCULATETABLE(
SUMMARIZE(
                   'Table1',
                   'Table1'[ProductID],
                   'Table1'[Year],
                   'Table1'[Month]  ),
                   "Sales",SUM('Table1'[Sales]),
                   "Expenses",SUM('Table1'[Expenses]),
                   "Products Sold",SUM('Table1'[Numbers Sold]),
                   'Table1'[Region] in {"Americas","Europe"},
                   'Table1'[Channel]="Online"
            )
                        

  • summer18 , Try Like

     

    SUMMARIZE(Filter(
    'Table1','Table1'[Region] in {"Americas","Europe"} &&
    'Table1'[Channel]="Online" )
    'Table1'[ProductID],
    'Table1'[Year],
    'Table1'[Month] ,
    "Sales",SUM('Table1'[Sales]),
    "Expenses",SUM('Table1'[Expenses]),
    "Products Sold",SUM('Table1'[Numbers Sold]) )

2 Replies

  • summer18 , Try Like

     

    SUMMARIZE(Filter(
    'Table1','Table1'[Region] in {"Americas","Europe"} &&
    'Table1'[Channel]="Online" )
    'Table1'[ProductID],
    'Table1'[Year],
    'Table1'[Month] ,
    "Sales",SUM('Table1'[Sales]),
    "Expenses",SUM('Table1'[Expenses]),
    "Products Sold",SUM('Table1'[Numbers Sold]) )