Forum Discussion
DAX
I think it's simple but need your help.
If I select a date in slicer then I have to show all dates of that month till selected date in slicer.
Anonymous , Create an independent date table as suggested in
https://www.youtube.com/watch?v=duMSovyosXE
and try formula like this
Measure = var _1 = DATESMTD('Sales date'[Dates]) return CALCULATE(sum(Sales[Sales]), filter(Sales,Sales[Date] in _1))
5 Replies
- amitchandakSuper User
Anonymous , In case you select a date and want to display more than those dates refer to this approach
https://www.youtube.com/watch?v=duMSovyosXE
Your filter will me
Measure =
var _max = maxx(allselected(Date),Date[Date])
Var _min = eomonth(_max,-1)+1
return
calculate([Measure], filter(All(Date), Date[Date]>=_min && Date[Date]<=_max))
As we are using all you need to follow the approach on youtube.
Or use relative date slicer: https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range
- AnonymousNot applicable
ok, but i want only till selected date of that month.
- amitchandakSuper User
Anonymous , That is where max alleselected will help
min is end date of last month and +1