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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
admin11
Memorable Member
Memorable Member

How to make the expression return 2021 instead of 2003 ?

Hi All

 
I have below expression from @amitchandak , it return 2003 , how to make it display 2021 ?
 
TITLE YTD DATE =
var _max = today()
var _min = minx(allselected('Date'), 'Date'[Date])

return format(_min, "MMM-YYYY") & " to " & format(_max, "MMM-YYYY") & " SALES PERIOD"
 

admin11_0-1620132081220.png

Paul Yeo

1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@admin11 

 

see if below works for you.

TITLE YTD DATE =
VAR _max =
TODAY ()
VAR _min =
MINX ( ALLSELECTED ( 'Date' ), 'Date'[Date] )
VAR _year =
FORMAT ( _max, "YYYY" )
RETURN
FORMAT ( _min, "MMM" ) & _year & " to "
& FORMAT ( _max, "MMM" ) & _year & " SALES PERIOD"




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

2 REPLIES 2
negi007
Community Champion
Community Champion

@admin11 

 

see if below works for you.

TITLE YTD DATE =
VAR _max =
TODAY ()
VAR _min =
MINX ( ALLSELECTED ( 'Date' ), 'Date'[Date] )
VAR _year =
FORMAT ( _max, "YYYY" )
RETURN
FORMAT ( _min, "MMM" ) & _year & " to "
& FORMAT ( _max, "MMM" ) & _year & " SALES PERIOD"




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

@negi007 

Thank you very much 

it work fine now

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.