Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
The query below takes 30-60 seconds for 10k users, consuming a lot of processor and network bandwith while it runs. Is there a faster way to write this query? I suspect that I am downloading the entire set of tables in #"records" but I am not sure how to select the user table directly.
let
Source = ActiveDirectory.Domains("domain.com"),
#"records" = Source{[Domain="sub.domain.com"]}[#"Object Categories"],
#"select user table" = #"records"{[Category="user"]}[Objects],
#"get principal name" = Table.ExpandRecordColumn(
#"select user table",
"top", {"msDS-PrincipalName"},
{"Principal Name"}),
#"filter principal name" = Table.SelectColumns(
#"get principal name",
{"Principal Name"})
in
#"filter principal name"
Thanks in advance..
Based on my research, it seems that Query Folding is not supported. Try to change the sequence of the last two steps and check if it helps.
let
Source = ActiveDirectory.Domains("domain.com"),
#"records" = Source{[Domain="sub.domain.com"]}[#"Object Categories"],
#"select user table" = #"records"{[Category="user"]}[Objects],
#"filter top" = Table.SelectColumns(
#"select user table",
{"top"}),
#"get principal name" = Table.ExpandRecordColumn(
#"filter top",
"top", {"msDS-PrincipalName"},
{"Principal Name"})
in
#"get principal name"
Thanks for the suggestion, unfortunatelly it didn't appear to load any faster, or if it did the difference smaller than the variation in just running the same query twice.
Isaac
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Check out the July 2026 Power BI update to learn about new features.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |