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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How to filter SUMMARIZECOLUMNS

Hi all, I am trying to filter the SUMMARIZECOLUMNS by using the CALCULATETABLE, it prompted me an error message:

"SummarizeColumns can not have outside filter context"

My tabular version: 13.0.2213.0

 

 

EVALUATE
CALCULATETABLE(
	SUMMARIZECOLUMNS(
		'Product'[Model Name],
		'Product'[Product Line],
		'Product'[Product Name],
		'Customer'[First Name],
		'Customer'[Last Name],
		"Internet Current Quarter Sales", [Internet Current Quarter Sales],
		"Internet Total Sales", [Internet Total Sales]
	),
	'Internet Sales'[Order Date] > DATEVALUE("1 Jan 2011"),
	OR('Geography'[Country Region Name] = "Australia", 'Geography'[Country Region Name] = "United States")
)
ORDER BY 'Product'[Model Name]

 

I can filter by put the FILTER function inside SUMMARIZECOLUMNS, however it gave me a different result (less records than expected) as the table was filtered before corss-join: https://docs.microsoft.com/en-us/dax/summarizecolumns-function-dax

 

EVALUATE
SUMMARIZECOLUMNS(
	'Product'[Model Name],
	'Product'[Product Line],
	'Product'[Product Name],
	'Customer'[First Name],
	'Customer'[Last Name],
	FILTER('Internet Sales', [Order Date] > DATEVALUE("1 Jan 2011")),
	FILTER('Geography', [Country Region Name] = "Australia" || [Country Region Name] = "United States"),
	"Internet Current Quarter Sales", [Internet Current Quarter Sales],
	"Internet Total Sales", [Internet Total Sales]
)
ORDER BY 'Product'[Model Name]

 

filterTable:

A table expression which is added to the filter context of all columns specified as groupBy_columnName arguments. The values present in the filter table are used to filter before cross-join/auto-exist is performed.

 

Any idea how to achive the filter same as CALCULATETABLE function? Thank you.

1 REPLY 1
Anonymous
Not applicable

As described in this article, the SUMMARIZECOLUMNS can only have outside filter context with Analysis Services 2016 SP1 and above

https://www.sqlbi.com/articles/introducing-summarizecolumns/

 

Is there any other way to achieve the outside filter without upgrade SSAS?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.