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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
bssienes
Regular Visitor

Power bi data range slicer beginning date

Hi all,

 

As you can see in the figure below, Last 1 month is selected on the date range slicer. However, it is showing the date range based on today's date. I want this filter to select dates based on the current month so the beginning date on the filter must be the 1st of May. If I select last 2 months, then beginning date should be april 1st. How can I do this?

 

bssienes_0-1683745968142.png

 

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Assuming you have a Calendar Table with Year and Month columns, just drag those 2 columns to your visual and write this measure

Measure = sum(Data[Sales])


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@bssienes , You have to create a date slicer (independent date table), then a number slicer -numeric parameter ([what if measure]) and then a period slicer (using independent table)

 

Then you have get dates like

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])

var _min = Switch(selectedvalues(period[period]) ,

"Month", date(year(_max), month(_max)  + [what if patam], day(_max) ) ,

"Day", date(year(_max), month(_max)  , day(_max) + [what if patam]) ,

"Quarter", date(year(_max), month(_max)  + [what if patam]*3, day(_max) ) ,

"Year", date(year(_max) + [what if patam] , month(_max)  , day(_max) )

)
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors