Forum Discussion
Barry_Kelly
9 years agoNew Member
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...
- 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.
Barry_Kelly
9 years agoNew Member
The question is how to use the results from the parameter table in the Date.IsInPreviousNDays function.
MarcelBeug
9 years agoCommunity Champion
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.