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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Swastik79
New Member

Getting error this query uses more memory than configured limit

I am creating a new column using the following formula:

 

Calculated Column =
 IF( SELECTEDVALUE('Country Dimension'[Country]) IN {"Country 1", "Country 2", "Country 3"}, "Value 1",
 IF( SELECTEDVALUE('Country Dimension'[Country]) IN {"Country 4"}, "Value 2",
 IF( SELECTEDVALUE('Country Dimension'[Country]) IN {"Country 5"} && SELECTEDVALUE('Plant Dimension'[Plant]) IN {"Plant 1", "Plant 2", "Plant 3", "Plant 4"}, "Value 3",
 IF( SELECTEDVALUE('Country Dimension'[Country]) IN {"Country 5"} && SELECTEDVALUE('Plant Dimension'[Plant]) IN {"Plant 5", "Plant 6", "Plant 7"}, "Value 4", "Others"))))
 
But everytime I am trying to build a matrix using Country column as row and Calculated column as column I am getting the error "The query uses more memory than the configured limit". Can anyone suggest how I can modify my formula?
5 REPLIES 5
rubayatyasmin
Super User
Super User

Hi, @Swastik79 

 

try this one. 

 

Calculated Column =
VAR Country = SELECTEDVALUE('Country Dimension'[Country])
VAR Plant = SELECTEDVALUE('Plant Dimension'[Plant])

RETURN
SWITCH(
TRUE(),
Country IN {"Country 1", "Country 2", "Country 3"}, "Value 1",
Country = "Country 4", "Value 2",
Country = "Country 5" && Plant IN {"Plant 1", "Plant 2", "Plant 3", "Plant 4"}, "Value 3",
Country = "Country 5" && Plant IN {"Plant 5", "Plant 6", "Plant 7"}, "Value 4",
"Others"
)

 

make sure to adjust column names. 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Hi @rubayatyasmin,

 

On using the above formula when i try to use calculated column as a row in a matrix it only shows "Others" as row. Can you edit the formula such that it displays "Value 1", "Value 2", "Value 3", "Value 4", "Others" as rows?

try this one. 

Calculated Column =
VAR Country = SELECTEDVALUE('Country Dimension'[Country])
VAR Plant = SELECTEDVALUE('Plant Dimension'[Plant])

RETURN
SWITCH(
TRUE(),
Country IN {"Country 1", "Country 2", "Country 3"}, "Value 1",
Country = "Country 4", "Value 2",
Country = "Country 5" && Plant IN {"Plant 1", "Plant 2", "Plant 3", "Plant 4"}, "Value 3",
Country = "Country 5" && Plant IN {"Plant 5", "Plant 6", "Plant 7"}, "Value 4",
"Others"
) & "-" & Country

 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Hi @rubayatyasmin,

 

On using the above formula when i try to use calculated column as a row in a matrix it now only shows "Others-" as row.

a demo data file would be appreciated. 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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