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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sekic
Helper I
Helper I

SQL Query how to call table function with value of USERPRINCIPALNAME()

In query editor I try to call table function which have one varchar input parameter.

When parameter is constant, return rows are fine.

In SQL Profiler I can see that Power BI call comand such as "select ... from function('abc@xyz.com')"

But when try to use USERPRINCIPALNAME() as value (either as USERPRINCIPALNAME() or as Text.From(USERPRINCIPALNAME())) response is invalid, because Power BI call is "select ... from function('USERPRINCIPALNAME()')" or

"select ... from function('Text.From(USERPRINCIPALNAME())) ')".

It use constant 'USERPRINCIPALNAME()' instead of value of dax function USERPRINCIPALNAME().

 

How to send real value to table function?

 

 

1 REPLY 1
Anonymous
Not applicable

Hi @sekic,

 

Current USERPRINCIPALNAME function only available on report view, you can't use it in power query custom function.
In my opinion, you can try to get all records and use dynamic RLS to filter data.


For detail information about dynamic RLS, you can refer to below links:

Power BI – Dynamic Row Level Security – Tips to get it working!

Tutorial: Dynamic row level security with Analysis services tabular model


Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors