Forum Discussion
Two date slicers for start and end date
- Anonymous3 years ago
Hi moyedgi ,
Please try below steps:
1. below is my test table
Table:
Table2:
Table 2 = CALENDAR(FIRSTDATE('Table'[Date]),LASTDATE('Table'[Date]))Table3:
Table 3 = CALENDAR(FIRSTDATE('Table'[Date]),LASTDATE('Table'[Date]))2. create measure with below dax formula
Measure = VAR st_date = SELECTEDVALUE ( 'Table 2'[Date] ) VAR ed_date = SELECTEDVALUE ( 'Table 3'[Date] ) VAR tmp = CALENDAR ( st_date, ed_date ) VAR cur_date = SELECTEDVALUE ( 'Table'[Date] ) RETURN IF ( cur_date IN tmp, 1, 0 )3. add two slicer with Table2 and Table3, add table visual with Table fields and add measure to it filter pane
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi moyedgi ,
Possibly, you can use two date tables and use each table data in one slicer each and then in your measures or calculations, refer the values of these slicers. You do not want to use simpler solution of just using one slicer of data tabel, can you please indicate little more detail on your purpose. Perhaps someone here may suggest you some best practices.
Hope it helps.
Hi mahenkj2,
I'm trying to filter down all the revenues for each month and a year.
For example, if the range is from 2/1/2019 to 12/31/2021, the table will show monthly (columns) and yearly (rows) revenues, ideally having two slicers that I could put 2/1/2019 and 12/31/2021 dates that will filter down revenues only within that time frame.