Results 1 to 2 of 2

Thread: Query parameter always using current value instead of query result?

  1. #1

    Query parameter always using current value instead of query result?



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I feel like I must be missing something really, really basic here, but I've been trying to work with the newish Query Parameters, and no matter what I do the parameter always uses the "Current Value" rather than the value of the query I've tied it to. I have my parameter set to:

    Required: Check
    Type: Text
    Suggested Values: Query
    Query: UCN Query
    Current Value: 99 9903104 (since it won't let me leave it blank)

    UCN Query is below. No matter what I change that field in my table to, the UCN Query will show the correct result but the UCN Parameter itself will just use the current value. Any ideas what I'm doing wrong?
    let
    Source = #"Parameter Table",
    #"Filtered Rows" = Table.SelectRows(Source, each ([Parameters] = "UCN")),
    Values = #"Filtered Rows"{0}[Values],
    #"Converted to List" = {Values}
    in
    #"Converted to List"

  2. #2
    I see this was posted back in January, sorry not to have responded earlier.

    Source = #"Parameter Table", but your parameter is set to
    Required: Check
    Type: Text
    Suggested Values: Query
    Query: UCN Query
    Current Value: 99 9903104 (since it won't let me leave it blank)
    I'm probably being dense here, but I'm not sure how the one relates to the other.

    Here's my take on your M code:
    // filters rows where Parameters column value equals "UCN"
    Code:
    #"Filtered Rows" = Table.SelectRows(Source, each ([Parameters] = "UCN")),


    // filters to first row: '{0}' does this. '[Values]' displays only the value of cell in Values column
    Code:
    Values = #"Filtered Rows"{0}[Values],
    
    
    // converts 1st row of UCN rows, Values column to a list
    Code:
    #"Converted to List" = {Values}
    [/CODE]
    Do you see why values don't see to change?

    To find what you're looking for... please provide a bit more info.
    Last edited by euUbsd36R; 2017-05-17 at 01:42 PM. Reason: Better formatting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •