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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
westman
Regular Visitor

Date Slicer with starting with the Currentdate and then show data for the next 4 months

Hello-

I am new to Power Bi forums, this is my first post.  I am still absorbing how to work with DAX, and the proper way to present my scenario.  I have a line chart that on its x-axis i have a date field, on the Y-axis i have a count of future orders and their sales amount.

I would like to have a slicer utuilizing the date table have a measure that upon opening or refreshing the report it will start with the current date and then have a range of showing the forwarding 4 months worth of data. Utimately, I would like it to be able to drill down to the day.  Please any resources i may follow up with to solve this.

Any reccomendations on how to format future inquires, please advise.

 

Thank you for your time

Drew

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@westman , next 4 month based on today

 

4 Months Today =
var _min =  today()
var _max = eomonth(today(),4)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

or

 

next 4 Months Today =
var _min =  eomonth(today(),0) +1
var _max = eomonth(today(),4)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
westman
Regular Visitor

Thank you for your assistance @amitchandak .  This measure does accomplish my main goal.  However, if i may, i also use a date range slicer shown in the picture attached.  Do you have insight or advice onhow to have the slicer read the current date in accordance with the measure you provided?

Thank you for your assistance. Very appreciated.

Drew

curDateSlicerinfo.png 

amitchandak
Super User
Super User

@westman , next 4 month based on today

 

4 Months Today =
var _min =  today()
var _max = eomonth(today(),4)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

or

 

next 4 Months Today =
var _min =  eomonth(today(),0) +1
var _max = eomonth(today(),4)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.