Forum Discussion

Barry_Kelly's avatar
Barry_Kelly
New Member
9 years ago
Solved

Date.IsInPreviousNDays M code question

Date.IsInPreviousNDays([Text Range], 2) I'd like to use this function to dynamically query a fact table based on a slicer selection. Being unfamiliar with M, can another query, function or customi...
  • MarcelBeug's avatar
    MarcelBeug
    9 years ago

    You can either:

     

    Add 1 step to your first query: select the value, so the output of the query will be 1 value and you can replace the 2 in your function by <NameOfYourFirstQuery>.

     

    Or

     

    Replace the value 2 in your function by: Table.FirstValue(<NameOfYourFirstQuery>).

     

    I would prefer the first option.