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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
tswm00
Frequent Visitor

Expression.Evaluate to examine value of parameter?

Is it possible to use Expression.Evaluate to (dynamically) examine the value of a Power Query Parameter?

Trying the below results in null despite the parameter "InitFileGLOBAL" has a value.

 

let
  ParameterName = "InitFileGLOBAL",
  Source = Expression.Evaluate(ParameterName, #shared)
in
  Source
5 REPLIES 5
Vijay_A_Verma
Super User
Super User

You have to just say

let
   Source = InitFileGLOBAL
in
  Source

Thanks! I was unclear. I want to examine value dynamically and thus select what parameter to examine based on a string value representing the name of the parameter.

The way you have done is right. Check whether InitFileGLOBAL contains a value or not in Parameter screen. 

The null will come when there is no value in current value.

1.png

Thanks for your response!

I am trying to accomplish this in Power Query Online (Datamart)

When testing the same thing i Power Query for Excel it works as a charm so the question is if this is a permanent limitation in Power Query Online?

Online doesnt like the #share object or any other dynamic values in my queries (that works fine in the Excel version) so perhaps i need to rethink the design fundamentally.

tswm00_0-1654090019907.png

 

tswm00
Frequent Visitor

Perhaps Expression.Evaluate is not the right way?

Examining #share results in:

tswm00_0-1654086800246.png

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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