Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi. I'm trying to create a new table for use in a dynamic legend slicer and am getting the following error: "<pi>The resultset of a query to external data source has exceeded the maximums allowed size of '1000000' rows.</pi>".
I don't understand why this is happening. Shouldn't the resulting table contain only as many rows as categories I am using? Below is a screenshot showing all 24 of the fields I want in my LegendCategories table. Text highlighted in yellow are table names in the data model and items outlined in red are the field/column names.
And here is the DAX for the table with error message:
For ease of reading, here is the DAX code itself:
LegendCategories =
UNION(
SELECTCOLUMNS(
PatientDim,
"Category", PatientDim[RaceCategory1],
"Field", "Race Category"
),
SELECTCOLUMNS(
PatientDim,
"Category", PatientDim[RaceCategory2],
"Field", "Race"
),
SELECTCOLUMNS(
PatientDim,
"Category", PatientDim[Sex],
"Field", "Sex"
),
SELECTCOLUMNS(
CovidVaccinationStatusFact,
"Category", CovidVaccinationStatusFact[AgeGroup 1],
"Field", "Age Group"
),
SELECTCOLUMNS(
CovidVaccinationStatusFact,
"Category", CovidVaccinationStatusFact[CovidVaccinated],
"Field", "Vaccination Status"
),
SELECTCOLUMNS(
CovidVaccinationStatusFact,
"Category", CovidVaccinationStatusFact[Booster],
"Field", "Booster Status"
)
)
My expected output:
| Category | Field |
| Female | Sex |
| Male | Sex |
| Other | Sex |
| BIPOC | Race Category |
| Unknown | Race Category |
| White | Race Category |
| Not Vaccinated | Vaccination Status |
| Vaccinated | Vaccination Status |
| Booster | Booster Status |
| No Booster | Booster Status |
etc.
Am I doing something wrong or just misunderstanding how this works?
Solved! Go to Solution.
@cathoms you are using DQ and the intermediate result exceeding the 1M rows.
I guess patientdim has a lot of rows.
Maybe try to change the code to:
LegendCategories =
UNION (
SELECTCOLUMNS (
VALUES ( PatientDim[RaceCategory1] ),
"Category", PatientDim[RaceCategory1],
"Field", "Race Category"
),
SELECTCOLUMNS (
VALUES ( PatientDim[RaceCategory2] ),
"Category", PatientDim[RaceCategory2],
"Field", "Race"
),
SELECTCOLUMNS (
VALUES ( PatientDim[Sex] ),
"Category", PatientDim[Sex],
"Field", "Sex"
),
SELECTCOLUMNS (
VALUES ( CovidVaccinationStatusFact[AgeGroup 1] ),
"Category", CovidVaccinationStatusFact[AgeGroup 1],
"Field", "Age Group"
),
SELECTCOLUMNS (
VALUES ( CovidVaccinationStatusFact[CovidVaccinated] ),
"Category", CovidVaccinationStatusFact[CovidVaccinated],
"Field", "Vaccination Status"
),
SELECTCOLUMNS (
VALUES ( CovidVaccinationStatusFact[Booster] ),
"Category", CovidVaccinationStatusFact[Booster],
"Field", "Booster Status"
)
)
Oh, great idea! Works perfectly, thanks!
@cathoms my pleasure 🙂
Hey, check out my showcase report - got some high level stuff there. Sure you will find there a lot of cool ideas.
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up over there if you liked it 🙂
@cathoms you are using DQ and the intermediate result exceeding the 1M rows.
I guess patientdim has a lot of rows.
Maybe try to change the code to:
LegendCategories =
UNION (
SELECTCOLUMNS (
VALUES ( PatientDim[RaceCategory1] ),
"Category", PatientDim[RaceCategory1],
"Field", "Race Category"
),
SELECTCOLUMNS (
VALUES ( PatientDim[RaceCategory2] ),
"Category", PatientDim[RaceCategory2],
"Field", "Race"
),
SELECTCOLUMNS (
VALUES ( PatientDim[Sex] ),
"Category", PatientDim[Sex],
"Field", "Sex"
),
SELECTCOLUMNS (
VALUES ( CovidVaccinationStatusFact[AgeGroup 1] ),
"Category", CovidVaccinationStatusFact[AgeGroup 1],
"Field", "Age Group"
),
SELECTCOLUMNS (
VALUES ( CovidVaccinationStatusFact[CovidVaccinated] ),
"Category", CovidVaccinationStatusFact[CovidVaccinated],
"Field", "Vaccination Status"
),
SELECTCOLUMNS (
VALUES ( CovidVaccinationStatusFact[Booster] ),
"Category", CovidVaccinationStatusFact[Booster],
"Field", "Booster Status"
)
)
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 32 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 66 | |
| 58 | |
| 31 | |
| 25 | |
| 24 |