Forum Discussion
Anonymous
4 years agoNot applicable
How to filter based on an input date
Hello, I would like to filter my data based on a date input. Create a slider like to determine a day in the month and use that value inside of measures. How could I create that (the input & the ...
Greg_Deckler
Community Champion
4 years agoAnonymous You would put a Date column into a Slicer visual. I believe that this is going to default to a slider where you can select a start and end time but you can change this using the little down caret icon in the upper right. Then, you can use this DAX to get the date/dates:
VAR __Min = MIN('Dates'[Date])
VAR __Max = MAX('Dates'[Date])
Anonymous
4 years agoNot applicable
Thank you for the answer Greg_Deckler .
I am trying to apply this solution, created a new table and added dummy dates inside of a column.
Here is the dax query that I am then using in order to try to filter the date:
currentMonthPunchedHours = CALCULATE(sum(punches[hours]), and(True, and(YEAR(punches[punchIn]) * 12 + MONTH(punches[punchIn]) = YEAR(TODAY()) * 12 + MONTH(TODAY()), and(YEAR(punches[punchOut]) * 12 + MONTH(punches[punchOut]) = YEAR(TODAY()) * 12 + MONTH(TODAY()), DAY('measure stuff'[breakEnd]) > DAY(punches[punchIn])))))
I am getting the error 'a function "placeholder" has been used in a True/False expression that is sued as a table filter expression. This is not allowed'.
In the dax query above, punchIn is the date to be filtered on, and breakEnd is "Max..." as mentionned in your answer.
Thanks for the help.