Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

recalling date in Mquery

I have a table which has dynamic date value column  having only one value( AS_OF_DATE - 04/30/2020 ) this should be recalled and filter the data in another table.

 

What is the best approach to recall this value in another table in Mquery.

 

I have created a list for AS_OF_DATE and recalled in te Mquery ,however its not working as expected. 

 

Here is the sampple code:

 

#"Filtered Rows" = Table.SelectRows(#"Renamed Columns1", each ([PROCESS_DATE] = AS_OF_DATE))

2 Replies

  • edhans's avatar
    edhans
    Community Champion

    Make sure the As_Of_Date is a scalar value, not a table.

    Fastest way is to right-click on it and Drill Down. Make sure it is the proper data type - text, date, integer, whatever.

    It will then look like this:

    You can then use the above any place you would use a date. I call these variables and use them all of the time. They can be dynamically calulated on other data before being drilled down - min/max of a date column in another table for example, or today's date.

    Note that you could call it by using different syntax if you left it in a table. As_Of_Date{0}[Column1] in your Table.SelectRows function, but that is a hassle. So unless you need to leave As_Of_Date as a table for other reasons, convert it and make all subsequent references easier to do.

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous - Does it have to be a separate table versus could you code it into a function? Otherwise, I would just put a reference to the other query in this query and refer to it. ImkeF edhans