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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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