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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Dynamic Text Box with Date Range

Hi,

 

I would like to add a text box that  dynamically shows the rolling 12 month date range in my Month & Year page filter which is set to Relative Date, is in the last 12 calendar months.

 

For example I would like the Text box to read as below:

 

Starters Diversity - Rolling 12 Months  01/12/2021 - 30/11/2022

 

Would be very grateful for any help with this.

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , You can create a measure and use that in text box, make sure Q&A feature is enabled

 

new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = eomonth(_max, -12) +1

return

"Rolling 12 Month " & _mn & " to " _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

View solution in original post

Anonymous
Not applicable

Managed to get this to work with date format in DD/MM/YYYY for UK format.

 

Rolling 12Mth Title =
VAR _Max = FORMAT(MAXX(ALLSELECTED(Dates),Dates[Date]),"DD/MM/YYYY")
VAR _Min = EOMONTH(_MAX,-12)+1
RETURN
FORMAT(_Min,"DD/MM/YYYY")&" to "&_Max

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@amitchandak  this is perfect thank you!

amitchandak
Super User
Super User

@Anonymous , You can create a measure and use that in text box, make sure Q&A feature is enabled

 

new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = eomonth(_max, -12) +1

return

"Rolling 12 Month " & _mn & " to " _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
Anonymous
Not applicable

Just a quick question how can I get the dates to show DD/MM/YYYY format?

Anonymous
Not applicable

Managed to get this to work with date format in DD/MM/YYYY for UK format.

 

Rolling 12Mth Title =
VAR _Max = FORMAT(MAXX(ALLSELECTED(Dates),Dates[Date]),"DD/MM/YYYY")
VAR _Min = EOMONTH(_MAX,-12)+1
RETURN
FORMAT(_Min,"DD/MM/YYYY")&" to "&_Max

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.