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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
isaachimanga
Regular Visitor

Active Directory Users Query is Slow

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

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@isaachimanga,

 

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"
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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