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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ashishpbi
Frequent Visitor

DAX query - Access to read AD Security Group members

Hello,

 

Is there a way to read Active Directory security group members in DAX (any function or any other way) ?

 

Thanks.

 

2 ACCEPTED SOLUTIONS
aduguid
Super User
Super User

You could use Power Query to bring it in as a source 

let
    // Define your domain controller and group
    DomainController = "your.domain.controller",
    GroupName = "YourGroupName",
    
    // Query Active Directory for group members
    Source = ActiveDirectory.Domains(DomainController),
    GroupMembers = Source{[Name=GroupName]}[Members],
    
    // Convert the result into a table
    MembersTable = Table.FromList(GroupMembers, Splitter.SplitByNothing(), {"Member"}),
    
    // Expand the result to include additional member details as needed
    ExpandedMembersTable = Table.ExpandRecordColumn(MembersTable, "Member", {"Name", "SamAccountName", "DistinguishedName"})
in
    ExpandedMembersTable

View solution in original post

v-yohua-msft
Community Support
Community Support

Hi, @ashishpbi 

As sroy_16 said,DAX (Data Analysis Expressions) itself does not have a built-in function to directly query Active Directory (AD) security group members. However, you can do this by using Power Query in Power BI, which allows you to connect to Active Directory and retrieve the necessary data. You can refer to the following links:

Solved: PowerBI to Query AD Group Memberships - Microsoft Fabric Community

 

Getting a list of AD Groups and their members using PowerQuery | Matt40k

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yohua-msft
Community Support
Community Support

Hi, @ashishpbi 

As sroy_16 said,DAX (Data Analysis Expressions) itself does not have a built-in function to directly query Active Directory (AD) security group members. However, you can do this by using Power Query in Power BI, which allows you to connect to Active Directory and retrieve the necessary data. You can refer to the following links:

Solved: PowerBI to Query AD Group Memberships - Microsoft Fabric Community

 

Getting a list of AD Groups and their members using PowerQuery | Matt40k

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sroy_16
Resolver II
Resolver II

Hello @ashishpbi 

 

Using DAX you cannot read Active Directory security group members, but however you can do the same using power query and M language.

Below is an example you can try. rename your filename accordingly.
let


Source = Csv.Document(Web.Contents("https://example.com/ADGroupMembers.csv"), [Delimiter=",", Columns=2, Encoding=65001, QuoteStyle=QuoteStyle.None]),
PromotedHeaders = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
PromotedHeaders


Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

aduguid
Super User
Super User

You could use Power Query to bring it in as a source 

let
    // Define your domain controller and group
    DomainController = "your.domain.controller",
    GroupName = "YourGroupName",
    
    // Query Active Directory for group members
    Source = ActiveDirectory.Domains(DomainController),
    GroupMembers = Source{[Name=GroupName]}[Members],
    
    // Convert the result into a table
    MembersTable = Table.FromList(GroupMembers, Splitter.SplitByNothing(), {"Member"}),
    
    // Expand the result to include additional member details as needed
    ExpandedMembersTable = Table.ExpandRecordColumn(MembersTable, "Member", {"Name", "SamAccountName", "DistinguishedName"})
in
    ExpandedMembersTable

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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

Top Solution Authors
Users online (728)