Forum Discussion
Filter a table by date using DAX - again
- 4 years ago
Anonymous the above code is for table not meaure
so either create a table
to create a measure like
countorws(CALCULATETABLE(
'date table',
DATESBETWEEN ( 'date table'[date], DATE(2021,12,26), TODAY())
))
amitchandak and johnt75 , thank you both! I like both your answers. amitchandak , yes, as a new user of DAX, I do still struggle with Measures versus Tables. And yes, copying my code from the measure to a newly created table made a new range-constrained table just like I wanted. johnt75 , that is clever! I had been fighting with a filter on the slicer visual. I tried Advanced Filtering and selected "is on or after" and put in the Dec 26, 2021 date but when I tried to use the "And" option, there was no obvious way to specify is "is on or before" TODAY. But your idea creates a solution to that problem! Nice.
Now I need to decide who to give the "Accept as Solution" award... Dang, both ideas work and make sense.... amitchandak , I'm giving it to you since your's was yet another step in my trying to sort out the proper application of measures versus tables. But johnt75 , I'm probably actually going to use your solution in my current report. Wish I could give it to both of you!