Forum Discussion
DAX help with dates
- Anonymous5 years ago
NielsDW
I assume you want to create a slicer to change the date range dynamically, like last 1 month, 2 months, 3 months, etc.In this case, you may create a new table usiong enter data to create a slicer column with values, 1,2,3,4,etc. And use this column create a slicer on the report page. Then just replace the X to selectedvalue() in the dax.
CALCULATE(DISTINCTCOUNT(Table[Customers], table[LastDateOfObtainedResult] >= DATE(YEAR(today(), MONTH(today()) - selectedvalue(newtable[slicer column]), DAY(today()).
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
NielsDW
I assume you want to create a slicer to change the date range dynamically, like last 1 month, 2 months, 3 months, etc.
In this case, you may create a new table usiong enter data to create a slicer column with values, 1,2,3,4,etc. And use this column create a slicer on the report page. Then just replace the X to selectedvalue() in the dax.
CALCULATE(DISTINCTCOUNT(Table[Customers], table[LastDateOfObtainedResult] >= DATE(YEAR(today(), MONTH(today()) - selectedvalue(newtable[slicer column]), DAY(today()).
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.