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 nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Using the Active Directory (AD) connector in Power Query (latest ver), I'm able to view all groups, but i'm not able to 'Expand' to Group.Member on AD groups that are Dynamic, or those groups that use LDAP queries to populate them.
Is this a feature/limitation of AD or a bug perhaps?
Here's the code that should return all users in a group.
let
Source = ActiveDirectory.Domains("DOMAIN.com"),
DOMAIN.com = Source{[Domain="DOMAIN.com"]}[#"Object Categories"],
group1 = DOMAIN.com{[Category="group"]}[Objects],
#"Expanded securityPrincipal" = Table.ExpandRecordColumn(group1, "securityPrincipal", {"sAMAccountName"}, {"securityPrincipal.sAMAccountName"}),
#"Filtered Rows" = Table.SelectRows(#"Expanded securityPrincipal", each [securityPrincipal.sAMAccountName] = "ALL-EmplsAndContractors"),
#"Expanded group" = Table.ExpandRecordColumn(#"Filtered Rows", "group", {"member"}, {"group.member"}),
#"Expanded group.member" = Table.ExpandListColumn(#"Expanded group", "group.member")
in
#"Expanded group.member"
I found a post here with some code that I am trying to adapt
https://matt40k.uk/2016/06/getting-a-list-of-ad-groups-and-their-members-using-powerquery/
It's a blog post.
If I get anywhere I will update this post.
Anyone get an answer on this? I would really like to get the number of users per group. I can see the count when I click on the List field for the record but would love to bring this value forward to report on it.
Hi,
did you resolve this issue or not ?
thank you,
best regards,
Lukas
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 16 | |
| 10 | |
| 10 | |
| 8 | |
| 7 |
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 34 | |
| 28 | |
| 20 |