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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GJ217
Resolver III
Resolver III

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

@GJ217 , 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

View solution in original post

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
GJ217
Resolver III
Resolver III

@amitchandak  this is perfect thank you!

amitchandak
Super User
Super User

@GJ217 , 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

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

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.