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.
dkay84_PowerBI
9 years agoMicrosoft Employee
I'm not sure I understand your objective. Are you trying to replace the hard coded "2" with a dynamic value?