Forum Discussion
Max date
- 3 years ago
Hi , toum
According to your description, you want to create a date slicer and you need to get the max date in table in the selected date range you selected.
Here are teh steps you can refer to :
(1)This is my test data:(2)We can click "New Table" to create a date table as a slicer:
Date SLicer = CALENDAR(FIRSTDATE('Table'[Date]) , LASTDATE('Table'[Date]))(3)Then we can create a measure :
Max Date = var _min_date = MIN('Date SLicer'[Date]) var _max_date = MAX('Date SLicer'[Date]) var _t = FILTER(ALLSELECTED('Table') ,'Table'[Date]>=_min_date && 'Table'[Date]<= _max_date) return MAXX(_t ,[Date])(4)Then we can put the filed we need on the visual and then we can meet your need the result is as follows:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
Create a Calendar Table. Create a relationship (Many to One and Single) from the Date column of the Data Table to the Date column of the Calendar Table. Write these measures
Total = sum(Data[Sale])
Farthest date = MAXX(filter(values(Calendar[Date]),[Total]>0),Calendar[Date])
Hope this helps.