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
Anonymous
Not applicable

how Can we pass USERPRINCIPLE or USERNAME as a query parameter in power BI

Hi,

 

I have oracle store proceure and I successfully loaded data using store procedure in Power BI, now I want to excute my store procedure dynamically with paramter, it shoud executed by power BI logind ID (username) , can anyone guide me how to do this.

 

your support will be highly appreciate. 

 

Thanks,

Sunil

1 ACCEPTED SOLUTION

Hi @Anonymous ,

as @lbendlin mentioned, you cannot retrieve these values with Power Query.

How about considering a workaround that fetches the user from the database login instead?
I'm using this function for it:

 

= ()=>
let
    Source = MySQL.Database("myDBconnectionString", "myTableName", [ReturnSingleDatabase=true, Query="SELECT current_user"]),
    current_user = Source{0}[current_user],
    Custom1 = Text.BeforeDelimiter(current_user, "@")
in
    Custom1

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Thankfully this is not possible.  If you need that level of control, use Row Level Security and/or Direct Query mode against the Oracle table or view.

Hi @Anonymous ,

as @lbendlin mentioned, you cannot retrieve these values with Power Query.

How about considering a workaround that fetches the user from the database login instead?
I'm using this function for it:

 

= ()=>
let
    Source = MySQL.Database("myDBconnectionString", "myTableName", [ReturnSingleDatabase=true, Query="SELECT current_user"]),
    current_user = Source{0}[current_user],
    Custom1 = Text.BeforeDelimiter(current_user, "@")
in
    Custom1

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

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.

Top Solution Authors