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
Anonymous
Not applicable

The resultset of a query to external data source has exceeded the maximum allowed size of '1000000'

Hi Community Users,

 

I am getting one error in Power BI desktop while pulling the dimension column in the table visual against a measure using direct query mode connected to snowflake database.

Error Message:
The resultset of a query to external data source has exceeded the maximum allowed size of '1000000' rows.

 

Whatever dimensions been pulled don't have much rows to think of it should throw more than 1 million records.

The same dimesion used in slicer and the measure is not throwing any error

 

Below find the dax definition used in measure :

 
NPI MIX Within BAT-Base Period =
var Start_date=min('Time Hierarchy'[Calendar Date])
var End_date=max('Time Hierarchy'[Calendar Date])

Var Base_Start_date=MIN('SPI Monitoring'[Base Period Start Date])
Var Base_End_date=MIN('SPI Monitoring'[Base Period End Date])

var max_month = CALCULATE(MAX('Time Hierarchy'[Month Number]), ALLSELECTED('Time Hierarchy'[Calendar Date]))

var SPI_BRAND_CATEGORY=CALCULATE(SUMX('SPI Net Sales Volume',[Net_Sales_Volume_SPI_Agg]*CALCULATE([Seasonality Cal],'VW_PRICE_MOVES'[END_MONTH_SELECTED]=max_month)),FILTER('SPI Net Sales Volume','SPI Net Sales Volume'[SPI_PRO.Product Category SPI]=SELECTEDVALUE('SPI Product'[Product Category SPI])),'Time Hierarchy'[Calendar Date]>=Base_Start_date && 'Time Hierarchy'[Calendar Date]<=Base_End_date)

Var SPI_BRAND_HOUSE=CALCULATE(SUMX('SPI Net Sales Volume',[Net_Sales_Volume_SPI_Agg]*CALCULATE([Seasonality Cal],'VW_PRICE_MOVES'[END_MONTH_SELECTED]=max_month)),FILTER('SPI Net Sales Volume',and(('SPI Net Sales Volume'[SPI_PRO.Brand House SPI]=SELECTEDVALUE('SPI Product'[Brand House SPI])),'SPI Net Sales Volume'[SPI_PRO.Product Category SPI]=SELECTEDVALUE('SPI Product'[Product Category SPI]))),'Time Hierarchy'[Calendar Date]>=Base_Start_date && 'Time Hierarchy'[Calendar Date]<=Base_End_date)
 
Var Brand_House_Brand_Category=IFERROR(SPI_BRAND_HOUSE/SPI_BRAND_CATEGORY,0)
 
return Brand_House_Brand_Category
 
 This dax measure was working fine and splitting across the dimensions previously but recently its not working also recently I have updated my Power BI desktop with latest version (May 2020) but don't know if it is happenning due to the latest Power BI release.
Power BI Version.PNG
 
Kindly help me how to resolve this issue and why I am getting the 1 million exceeded rows while pulling any of the dimensions related.
 
Regards,
Ashutosh Singh
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

This is a known issue that appears on directquery mode datasource when it return rows more than 1M.

Use DirectQuery in Power BI Desktop#limitations-of-directquery 
This is caused by 'return' rows, have you apply any t-sql queries or functions that will increase the return row amount? (e.g. join functions)

In addition, it seems like you are nested multiple iterator functions in your measure which will multiple its row contents amount.
I'd like to suggest you try to remove them from your visual to confirm if this issue is caused by these multiplied row contents.
Notice: iterate tables will obviously increase the calculation table row contents amount.
for example, iterator three tables with 1k, 2k, 5k rows.
Actual calculated row contents= 1000*2000*5000=10^10 rows that obviously over 1M(10^6) rows.

Optimizing nested iterators in DAX 
Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous,

This is a known issue that appears on directquery mode datasource when it return rows more than 1M.

Use DirectQuery in Power BI Desktop#limitations-of-directquery 
This is caused by 'return' rows, have you apply any t-sql queries or functions that will increase the return row amount? (e.g. join functions)

In addition, it seems like you are nested multiple iterator functions in your measure which will multiple its row contents amount.
I'd like to suggest you try to remove them from your visual to confirm if this issue is caused by these multiplied row contents.
Notice: iterate tables will obviously increase the calculation table row contents amount.
for example, iterator three tables with 1k, 2k, 5k rows.
Actual calculated row contents= 1000*2000*5000=10^10 rows that obviously over 1M(10^6) rows.

Optimizing nested iterators in DAX 
Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi, Ashutosh.

 

I am interested to know on how you solved the issue; I am facing a similar issue and the answer accepted is very vague.

 

Could you mention on how you solved this?

Helpful resources

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

June 2025 community update carousel

Fabric Community Update - June 2025

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