The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a fact table with well over a million rows that I am connected to with Direct Query. I need to create a detail view that just shows rows from that table. When I add fields from the fact to a Table vizual, it works fine. However if I also drag on a field from any of my Dimensions it triggers the million row limit.
This is the DAX Studio query trace when I add two fields from the Fact Table ('CCR Cases'[Case Number] and 'CCR Cases'[Case Details]:
EVALUATE
TOPN(
501,
SUMMARIZE('CCR Cases', 'CCR Cases'[Case Number], 'CCR Cases'[Case Details]),
'CCR Cases'[Case Number],
1,
'CCR Cases'[Case Details],
1
)
ORDER BY
'CCR Cases'[Case Number], 'CCR Cases'[Case Details]
Here is the query trace when I include a field from the dimension table ('UPC'[UPC Description])
EVALUATE
TOPN(
501,
SELECTCOLUMNS(
KEEPFILTERS(
FILTER(
KEEPFILTERS(
SUMMARIZECOLUMNS(
'CCR Cases'[Case Number],
'UPC'[UPC Description],
'CCR Cases'[Case Details],
"CountRowsCCR_Cases", CALCULATE(COUNTROWS('CCR Cases'))
)
),
OR(
OR(
NOT(ISBLANK('CCR Cases'[Case Number])),
NOT(ISBLANK('UPC'[UPC Description]))
),
NOT(ISBLANK('CCR Cases'[Case Details]))
)
)
),
"'CCR Cases'[Case Number]", 'CCR Cases'[Case Number],
"'UPC'[UPC Description]", 'UPC'[UPC Description],
"'CCR Cases'[Case Details]", 'CCR Cases'[Case Details]
),
'CCR Cases'[Case Number],
1,
'UPC'[UPC Description],
1,
'CCR Cases'[Case Details],
1
)
ORDER BY
'CCR Cases'[Case Number], 'UPC'[UPC Description], 'CCR Cases'[Case Details]
The obvious difference is the COUNTROWS expression in the second query. Is this what is triggering the million row limit? Is there a reason adding a field from a related table requires that?
Hi, @twilliams98103
Based on my research, there is a fixed limit of 1 million rows placed on the number of rows that can be returned in any single query to the underlying source. The limit can occur in cases where Power BI isn't fully optimizing the queries sent, and there's some intermediate result being requested that exceeds the limit even though the final result doesn't exceeds the limit.
Here are some suggestions for DircetQuery best practices.
For further information, you may refer to the following link.
https://docs.microsoft.com/en-us/power-bi/power-bi-reports-performance
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-alq-msft ,
I am aware of the 1 million row limit. What I am trying to understand is why the 1 million row limit is not triggered when I use fields from a single table but is with fields from two related table
I included the DAX from the query trace hoping that at least someone could explain why the second query violates the 1 million row limit but the first does not.
thanks
Dax functions like summarize and summarize columns may actually get that in power and calculate it.
Can you let us know what you are trying to achieve?
Also, refer Query Reduction
https://docs.microsoft.com/en-us/power-bi/desktop-directquery-about
https://www.youtube.com/watch?v=4kVw0eaz5Ws
And mix mode :
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin
I am simply trying to build a Table visual that displays row level detail. What I don't understand is why I can add as many fields as I want from my 4 million+ row fact table with no problem, but if I add just a single field from a joined dimension table to my table, I get the 1 million row limit error. What is it about adding a field from a joined table that causes the query to execute in such a way that it exceeds 1 million rows?
Hi! I also faced this issue. My conclusion was that the limit only applies when there are joins involved, if any of the individual query to each table is returning more than a million records before doing the join. And the workaround I found is to filter on fields of each table so that the 1 mill row limit is not exceeded.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
80 | |
71 | |
51 | |
50 |
User | Count |
---|---|
128 | |
122 | |
77 | |
64 | |
60 |