Forum Discussion

Harineeeeeeee's avatar
1 year ago
Solved

How to retrieve userprincipalname in Power query editor

I have a sql query which has to be filtered based on the userprincipalname  I don't see any option to filter by userprincipalname in Power query editor  Scenario if the userprincipalname storeid is ...
  • v-aatheeque's avatar
    v-aatheeque
    1 year ago

    Hi Harineeeeeeee ,
    Thanking for reaching out to fabric community forum.
    nilendraFabric  Thanks for your prompt response. In additon to that :

    • You need to retrieve the User Principal Name (UPN) from Active Directory and map it to its corresponding StoreID. This mapping should be stored in a security table within your database. Ensure that this table is updated regularly to keep all user-store associations current.
    • Once the data is stored in the security table, you can load it into Power Query for transformations, making it easier to query and analyze the data through a user-friendly interface.
    • Next, create a function that retrieves the StoreID based on the provided User Principal Name as a parameter (@parameter). Use this parameter to filter your SQL query.
    • However this function would need to be invoked from power query every time you need to query a user.

    If our response or a community member’s response addressed your query, please mark it as 'Accept Answer' and click 'Yes' if you found it helpful.

    If you have any further questions, feel free to reach out.
    Thank you for being a part of the Microsoft Fabric Community Forum!