Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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.

1 ACCEPTED SOLUTION

@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))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super 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

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

ok, but i want only till selected date of that month.

@Anonymous , That is where max alleselected will help

min is end date of last month and +1

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

it's not working. it gives error.

@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))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.